checkpatch: fix false positive on __initconst
PATCH 1/1 checkpatch: fix false positive on __initconst
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
---
Not entirely sure if adding the word boundary may cause a side-effect which I overlooked. A few more eyes on this would be great.
scripts/checkpatch.pl | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
scripts/checkpatch.pl +4 -1
@@ -142,11 +142,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|
Signature · 1 line
1.6.3.3
ping
Quoted 39 lines · Wolfram Sang
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 endSigned-off-by Wolfram Sang <[email protected]>Cc Andy Whitcroft <[email protected]>---
Not entirely sure if adding the word boundary may cause a side-effect which I overlooked. A few more eyes on this would be great.
scripts/checkpatch.pl | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)scripts/checkpatch.pl +4
-1@@ -142,11 +142,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|Signature · 1 line
1.6.3.3
Signature · 2 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |