Commit 1574a29f authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

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: default avatarJoe Perches <joe@perches.com>
Reported-by: default avatarHartley Sweeten <HartleyS@visionengravers.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e2826fd0
...@@ -435,7 +435,7 @@ sub build_types { ...@@ -435,7 +435,7 @@ sub build_types {
}x; }x;
$Type = qr{ $Type = qr{
$NonptrType $NonptrType
(?:(?:\s|\*|\[\])+\s*const|(?:\s|\*|\[\])+|(?:\s*\[\s*\])+)? (?:(?:\s|\*|\[\])+\s*const|(?:\s|\*\s*(?:const\s*)?|\[\])+|(?:\s*\[\s*\])+)?
(?:\s+$Inline|\s+$Modifier)* (?:\s+$Inline|\s+$Modifier)*
}x; }x;
$Declare = qr{(?:$Storage\s+(?:$Inline\s+)?)?$Type}; $Declare = qr{(?:$Storage\s+(?:$Inline\s+)?)?$Type};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment