提交 1574a29f 编写于 作者: J Joe Perches 提交者: 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: NJoe Perches <joe@perches.com>
Reported-by: NHartley Sweeten <HartleyS@visionengravers.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册