From 65dfc65d56d1913ba4197029117bc8cb36306c97 Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Tue, 10 Jan 2012 15:10:15 -0800 Subject: [PATCH] --- yaml --- r: 283081 b: refs/heads/master c: bfcb2cc798a14230d22b6dd999e2e680623de622 h: refs/heads/master i: 283079: d1ae240e5468f64453835e286ff206ac8cc7fdfc v: v3 --- [refs] | 2 +- trunk/scripts/checkpatch.pl | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 2112353411f7..0326c36d5367 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6b48db24e30d371bc54566667b82ca3d64aab80a +refs/heads/master: bfcb2cc798a14230d22b6dd999e2e680623de622 diff --git a/trunk/scripts/checkpatch.pl b/trunk/scripts/checkpatch.pl index eb4b55940c0e..e3bfcbe8a520 100755 --- a/trunk/scripts/checkpatch.pl +++ b/trunk/scripts/checkpatch.pl @@ -2209,8 +2209,9 @@ sub process { # * goes on variable not on type # (char*[ const]) - if ($line =~ m{\($NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)\)}) { - my ($from, $to) = ($1, $1); + while ($line =~ m{(\($NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)\))}g) { + #print "AA<$1>\n"; + my ($from, $to) = ($2, $2); # Should start with a space. $to =~ s/^(\S)/ $1/; @@ -2225,8 +2226,10 @@ sub process { ERROR("POINTER_LOCATION", "\"(foo$from)\" should be \"(foo$to)\"\n" . $herecurr); } - } elsif ($line =~ m{\b$NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)($Ident)}) { - my ($from, $to, $ident) = ($1, $1, $2); + } + while ($line =~ m{(\b$NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)($Ident))}g) { + #print "BB<$1>\n"; + my ($from, $to, $ident) = ($2, $2, $3); # Should start with a space. $to =~ s/^(\S)/ $1/;