]> git.baikalelectronics.ru Git - kernel.git/commit
checkpatch: avoid suggesting struct definitions should be const
authorJoe Perches <joe@perches.com>
Mon, 8 May 2017 22:55:45 +0000 (15:55 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 9 May 2017 00:15:11 +0000 (17:15 -0700)
commitddbdc04bc4c5da7b4a8e5f7a27df53a51fcc0781
tree22798a9063b6ffa1aaac2c208e9c9a3e2c29dc4f
parentd1d101e41ef7574e0e7742adafc0547239bfbc8e
checkpatch: avoid suggesting struct definitions should be const

Many structs are generally used const and there is a known list of these
structs.

struct definitions should not be generally be declared const.

Add a test for the lack of an open brace immediately after the struct to
avoid definitions.

This avoids the false positive "struct foo should normally be const"
message only when the open brace is on the same line as the definition.

Link: http://lkml.kernel.org/r/0dce709150d712e66f1b90b03827634b53b28085.1491845946.git.joe@perches.com
Signed-off-by: Joe Perches <joe@perches.com>
Cc: Arthur Brainville <ybalrid@ybalrid.info>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/checkpatch.pl