checkpatch: support function pointers for unnamed function definition arguments
Current unnamed function definition argument does not include function pointer cases and it reports something like: WARNING: function definition argument 'void' should also have an identifier name +unsigned int (*dummy)(void); Support function pointers for unnamed function arguments Link: http://lkml.kernel.org/r/1505389925-31087-1-git-send-email-miles.chen@mediatek.com Signed-off-by: Miles Chen <miles.chen@mediatek.com> Acked-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
4441fca0a2
commit
25bdda2bd6
@ -5957,7 +5957,7 @@ sub process {
|
|||||||
|
|
||||||
# check for function declarations that have arguments without identifier names
|
# check for function declarations that have arguments without identifier names
|
||||||
if (defined $stat &&
|
if (defined $stat &&
|
||||||
$stat =~ /^.\s*(?:extern\s+)?$Type\s*$Ident\s*\(\s*([^{]+)\s*\)\s*;/s &&
|
$stat =~ /^.\s*(?:extern\s+)?$Type\s*(?:$Ident|\(\s*\*\s*$Ident\s*\))\s*\(\s*([^{]+)\s*\)\s*;/s &&
|
||||||
$1 ne "void") {
|
$1 ne "void") {
|
||||||
my $args = trim($1);
|
my $args = trim($1);
|
||||||
while ($args =~ m/\s*($Type\s*(?:$Ident|\(\s*\*\s*$Ident?\s*\)\s*$balanced_parens)?)/g) {
|
while ($args =~ m/\s*($Type\s*(?:$Ident|\(\s*\*\s*$Ident?\s*\)\s*$balanced_parens)?)/g) {
|
||||||
|
Loading…
Reference in New Issue
Block a user