Skip to content

Commit 5e60328

Browse files
JoePerchessfrothwell
authored andcommitted
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 torvalds#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>
1 parent 81ae542 commit 5e60328

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/checkpatch.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ sub build_types {
435435
}x;
436436
$Type = qr{
437437
$NonptrType
438-
(?:(?:\s|\*|\[\])+\s*const|(?:\s|\*|\[\])+|(?:\s*\[\s*\])+)?
438+
(?:(?:\s|\*|\[\])+\s*const|(?:\s|\*\s*(?:const\s*)?|\[\])+|(?:\s*\[\s*\])+)?
439439
(?:\s+$Inline|\s+$Modifier)*
440440
}x;
441441
$Declare = qr{(?:$Storage\s+(?:$Inline\s+)?)?$Type};

0 commit comments

Comments
 (0)