Skip to content

Commit

Permalink
checkpatch: fix false positive on __initconst
Browse files Browse the repository at this point in the history
checkpatch falsely complained about '__initconst' because it thought the
'const' needed a space before.  Fix this by changing the list of
attributes:

- add '__initconst'
- force plain 'init' to contain a word-boundary at the end

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Wolfram Sang authored and torvalds committed Mar 6, 2010
1 parent 691e669 commit 5213129
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,14 @@ sub help {
__kprobes|
__ref
}x;

# Notes to $Attribute:
# We need \b after 'init' otherwise 'initconst' will cause a false positive in a check
our $Attribute = qr{
const|
__read_mostly|
__kprobes|
__(?:mem|cpu|dev|)(?:initdata|init)|
__(?:mem|cpu|dev|)(?:initdata|initconst|init\b)|
____cacheline_aligned|
____cacheline_aligned_in_smp|
____cacheline_internodealigned_in_smp|
Expand Down

0 comments on commit 5213129

Please sign in to comment.