diff options
author | Joe Perches <joe@perches.com> | 2014-08-06 19:10:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-06 21:01:28 -0400 |
commit | 1574a29f8e769998fe3e55eb6030dc61e3d09ccd (patch) | |
tree | 4826d2385418e45f61a6d2003097697f63352a27 /scripts | |
parent | e2826fd07029e14285c178b41b18f6edc3b15a84 (diff) |
checkpatch: allow multiple const * types
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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkpatch.pl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 9a89a0609bac..57a11d7ee841 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -435,7 +435,7 @@ sub build_types { | |||
435 | }x; | 435 | }x; |
436 | $Type = qr{ | 436 | $Type = qr{ |
437 | $NonptrType | 437 | $NonptrType |
438 | (?:(?:\s|\*|\[\])+\s*const|(?:\s|\*|\[\])+|(?:\s*\[\s*\])+)? | 438 | (?:(?:\s|\*|\[\])+\s*const|(?:\s|\*\s*(?:const\s*)?|\[\])+|(?:\s*\[\s*\])+)? |
439 | (?:\s+$Inline|\s+$Modifier)* | 439 | (?:\s+$Inline|\s+$Modifier)* |
440 | }x; | 440 | }x; |
441 | $Declare = qr{(?:$Storage\s+(?:$Inline\s+)?)?$Type}; | 441 | $Declare = qr{(?:$Storage\s+(?:$Inline\s+)?)?$Type}; |