From: Florian Mickler Date: Fri, 25 Nov 2011 09:24:16 +0000 (+0100) Subject: checkpatch.pl: fix CAST detection X-Git-Tag: TizenStudio_2.0_p2.3~1922 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=362bce735966a205757c00a86d60e294f0185f46;p=sdk%2Femulator%2Fqemu.git checkpatch.pl: fix CAST detection We should only claim that something is a cast if we did not encouter a token before, that did set av_pending. This fixes the operator * in the line below to be detected as binary (vs unary). kmalloc(sizeof(struct alphatrack_ocmd) * true_size, GFP_KERNEL); Reported-by: Peter Chubb Signed-off-by: Florian Mickler (cherry-picked from Linux kernel commit c023e4734c3e8801e0ecb5e81b831d42a374d861) Signed-off-by: Paolo Bonzini Cc: Blue Swirl Signed-off-by: Blue Swirl --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 7a71324..04ab990 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -859,7 +859,7 @@ sub annotate_values { $av_preprocessor = 0; } - } elsif ($cur =~ /^(\(\s*$Type\s*)\)/) { + } elsif ($cur =~ /^(\(\s*$Type\s*)\)/ && $av_pending eq '_') { print "CAST($1)\n" if ($dbg_values > 1); push(@av_paren_type, $type); $type = 'C';