mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] checkpatch: Allow multiple const * types
       [not found] <DC148C5AA1CEBA4E87973D432B1C2D8825ED00F7@P3PWEX4MB008.ex4.secureserver.net>
@ 2014-06-27 17:49 ` Joe Perches
  0 siblings, 0 replies; only message in thread
From: Joe Perches @ 2014-06-27 17:49 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Andy Whitcroft, Hartley Sweeten, LKML

checkpatch's $Type variable does not match declarations
of multiple const * types.

This can produce false positives for things like:

$ ./scripts/checkpatch.pl -f drivers/staging/comedi/comedidev.h
WARNING: Missing a blank line after declarations
#60: FILE: drivers/staging/comedi/comedidev.h:60:
+       const struct comedi_lrange *range_table;
+       const struct comedi_lrange *const *range_table_list;

Fix the $Type variable to support matching multiple "* const" uses.

Signed-off-by: Joe Perches <joe@perches.com>
Reported-by: Hartley Sweeten <HartleyS@visionengravers.com>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 6c7cbaf..f7ae70a 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -435,7 +435,7 @@ sub build_types {
 		  }x;
 	$Type	= qr{
 			$NonptrType
-			(?:(?:\s|\*|\[\])+\s*const|(?:\s|\*|\[\])+|(?:\s*\[\s*\])+)?
+			(?:(?:\s|\*|\[\])+\s*const|(?:\s|\*\s*(?:const\s*)?|\[\])+|(?:\s*\[\s*\])+)?
 			(?:\s+$Inline|\s+$Modifier)*
 		  }x;
 	$Declare	= qr{(?:$Storage\s+(?:$Inline\s+)?)?$Type};



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-06-27 17:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <DC148C5AA1CEBA4E87973D432B1C2D8825ED00F7@P3PWEX4MB008.ex4.secureserver.net>
2014-06-27 17:49 ` [PATCH] checkpatch: Allow multiple const * types Joe Perches

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®