diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkpatch.pl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index eb4b55940c0e..e3bfcbe8a520 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -2209,8 +2209,9 @@ sub process { | |||
2209 | 2209 | ||
2210 | # * goes on variable not on type | 2210 | # * goes on variable not on type |
2211 | # (char*[ const]) | 2211 | # (char*[ const]) |
2212 | if ($line =~ m{\($NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)\)}) { | 2212 | while ($line =~ m{(\($NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)\))}g) { |
2213 | my ($from, $to) = ($1, $1); | 2213 | #print "AA<$1>\n"; |
2214 | my ($from, $to) = ($2, $2); | ||
2214 | 2215 | ||
2215 | # Should start with a space. | 2216 | # Should start with a space. |
2216 | $to =~ s/^(\S)/ $1/; | 2217 | $to =~ s/^(\S)/ $1/; |
@@ -2225,8 +2226,10 @@ sub process { | |||
2225 | ERROR("POINTER_LOCATION", | 2226 | ERROR("POINTER_LOCATION", |
2226 | "\"(foo$from)\" should be \"(foo$to)\"\n" . $herecurr); | 2227 | "\"(foo$from)\" should be \"(foo$to)\"\n" . $herecurr); |
2227 | } | 2228 | } |
2228 | } elsif ($line =~ m{\b$NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)($Ident)}) { | 2229 | } |
2229 | my ($from, $to, $ident) = ($1, $1, $2); | 2230 | while ($line =~ m{(\b$NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)($Ident))}g) { |
2231 | #print "BB<$1>\n"; | ||
2232 | my ($from, $to, $ident) = ($2, $2, $3); | ||
2230 | 2233 | ||
2231 | # Should start with a space. | 2234 | # Should start with a space. |
2232 | $to =~ s/^(\S)/ $1/; | 2235 | $to =~ s/^(\S)/ $1/; |