mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
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 <[email protected]> Reported-by: Hartley Sweeten <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
1 parent
e2826fd070
commit
1574a29f8e
1 file changed
+1
-1
@@ -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};
|
||||
|
||||
Reference in new issue
Block a user