aboutsummaryrefslogtreecommitdiff
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorFlorian Mickler <florian@mickler.org>2011-11-25 10:24:16 +0100
committerBlue Swirl <blauwirbel@gmail.com>2011-11-26 09:47:00 +0000
commit61669f9a83c68d41d9254272f10f1e905f339427 (patch)
tree5ae6f0a045462b5d9dc3b9516e0fdc6c2bcbfd19 /scripts/checkpatch.pl
parent0fdd2e1d06884b0236c2f124c1cfd2dd4765341a (diff)
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 <nicta.com.au> Signed-off-by: Florian Mickler <florian@mickler.org> (cherry-picked from Linux kernel commit c023e4734c3e8801e0ecb5e81b831d42a374d861) Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 7a71324f6a..04ab990cc0 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';