aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/checkpatch.pl11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 83ae37b38621..5420db6502fc 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -171,6 +171,7 @@ our @modifierList = (
171sub build_types { 171sub build_types {
172 my $mods = "(?: \n" . join("|\n ", @modifierList) . "\n)"; 172 my $mods = "(?: \n" . join("|\n ", @modifierList) . "\n)";
173 my $all = "(?: \n" . join("|\n ", @typeList) . "\n)"; 173 my $all = "(?: \n" . join("|\n ", @typeList) . "\n)";
174 $Modifier = qr{(?:$Attribute|$Sparse|$mods)};
174 $NonptrType = qr{ 175 $NonptrType = qr{
175 (?:const\s+)? 176 (?:const\s+)?
176 (?:$mods\s+)? 177 (?:$mods\s+)?
@@ -178,15 +179,14 @@ sub build_types {
178 (?:typeof|__typeof__)\s*\(\s*\**\s*$Ident\s*\)| 179 (?:typeof|__typeof__)\s*\(\s*\**\s*$Ident\s*\)|
179 (?:${all}\b) 180 (?:${all}\b)
180 ) 181 )
181 (?:\s+$Sparse|\s+const)* 182 (?:\s+$Modifier|\s+const)*
182 }x; 183 }x;
183 $Type = qr{ 184 $Type = qr{
184 $NonptrType 185 $NonptrType
185 (?:\s*\*+\s*const|\s*\*+|(?:\s*\[\s*\])+)? 186 (?:\s*\*+\s*const|\s*\*+|(?:\s*\[\s*\])+)?
186 (?:\s+$Inline|\s+$Sparse|\s+$Attribute|\s+$mods)* 187 (?:\s+$Inline|\s+$Modifier)*
187 }x; 188 }x;
188 $Declare = qr{(?:$Storage\s+)?$Type}; 189 $Declare = qr{(?:$Storage\s+)?$Type};
189 $Modifier = qr{(?:$Attribute|$Sparse|$mods)};
190} 190}
191build_types(); 191build_types();
192 192
@@ -715,7 +715,7 @@ sub annotate_values {
715 $av_preprocessor = 0; 715 $av_preprocessor = 0;
716 } 716 }
717 717
718 } elsif ($cur =~ /^($Type)/) { 718 } elsif ($cur =~ /^($Type)\s*(?:$Ident|,|\))/) {
719 print "DECLARE($1)\n" if ($dbg_values > 1); 719 print "DECLARE($1)\n" if ($dbg_values > 1);
720 $type = 'T'; 720 $type = 'T';
721 721
@@ -800,8 +800,9 @@ sub annotate_values {
800 print "PAREN('$1')\n" if ($dbg_values > 1); 800 print "PAREN('$1')\n" if ($dbg_values > 1);
801 } 801 }
802 802
803 } elsif ($cur =~ /^($Ident)\(/o) { 803 } elsif ($cur =~ /^($Ident)\s*\(/o) {
804 print "FUNC($1)\n" if ($dbg_values > 1); 804 print "FUNC($1)\n" if ($dbg_values > 1);
805 $type = 'V';
805 $av_pending = 'V'; 806 $av_pending = 'V';
806 807
807 } elsif ($cur =~ /^($Ident|$Constant)/o) { 808 } elsif ($cur =~ /^($Ident|$Constant)/o) {