From: Joe Perches Date: Wed, 6 Aug 2014 23:10:50 +0000 (-0700) Subject: checkpatch: allow multiple const * types X-Git-Tag: v4.9.8~5947^2~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1574a29f8e769998fe3e55eb6030dc61e3d09ccd;p=platform%2Fkernel%2Flinux-rpi3.git 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 Reported-by: Hartley Sweeten Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 9a89a06..57a11d7 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};