checkpatch: fix false positive on __initconst
authorWolfram Sang <w.sang@pengutronix.de>
Fri, 5 Mar 2010 21:43:51 +0000 (13:43 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 6 Mar 2010 19:26:44 +0000 (11:26 -0800)
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>
scripts/checkpatch.pl

index 9a3894dbf752354a0a05dd70e6a42ec747eb92eb..1530dbf1dab51335ed7e9055e0a6abc25ef8249b 100755 (executable)
@@ -145,11 +145,14 @@ our $Sparse       = qr{
                        __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|