checkpatch: ensure cast type is unique in the context parser
authorAndy Whitcroft <apw@canonical.com>
Tue, 10 Jan 2012 23:10:11 +0000 (15:10 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Jan 2012 00:30:51 +0000 (16:30 -0800)
Ensure the cast type is unique in the context parser, we do not want them
to detect as a comma ','.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

scripts/checkpatch.pl

index ba7bcf3..497416c 100755 (executable)
@@ -1032,7 +1032,7 @@ sub annotate_values {
                } elsif ($cur =~ /^(\(\s*$Type\s*)\)/ && $av_pending eq '_') {
                        print "CAST($1)\n" if ($dbg_values > 1);
                        push(@av_paren_type, $type);
-                       $type = 'C';
+                       $type = 'c';
 
                } elsif ($cur =~ /^($Type)\s*(?:$Ident|,|\)|\(|\s*$)/) {
                        print "DECLARE($1)\n" if ($dbg_values > 1);