mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] checkpatch: fix false positive on __initconst
@ 2009-10-19  9:49 Wolfram Sang
  2009-11-16 14:02 ` Wolfram Sang
  0 siblings, 1 reply; 2+ messages in thread
From: Wolfram Sang @ 2009-10-19  9:49 UTC (permalink / raw)
  To: linux-kernel; +Cc: Wolfram Sang, Andy Whitcroft

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>
---

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(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 87bbb8b..0a47a1f 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -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|
-- 
1.6.3.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] checkpatch: fix false positive on __initconst
  2009-10-19  9:49 [PATCH] checkpatch: fix false positive on __initconst Wolfram Sang
@ 2009-11-16 14:02 ` Wolfram Sang
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2009-11-16 14:02 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andy Whitcroft

[-- Attachment #1: Type: text/plain, Size: 1499 bytes --]

ping

On Mon, Oct 19, 2009 at 11:49:14AM +0200, Wolfram Sang wrote:
> 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>
> ---
> 
> 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(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 87bbb8b..0a47a1f 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -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|
> -- 
> 1.6.3.3
> 

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-16 14:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-19  9:49 [PATCH] checkpatch: fix false positive on __initconst Wolfram Sang
2009-11-16 14:02 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®