diff options
author | Florian Mickler <florian@mickler.org> | 2011-01-12 19:59:58 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 11:03:11 -0500 |
commit | c023e4734c3e8801e0ecb5e81b831d42a374d861 (patch) | |
tree | a497964957d6dd30baa52ffe7a175737599ebca0 /scripts | |
parent | caf2a54f101a55ec318c2a20253a1977802f7de4 (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: Audun Hoem <audun.hoem@gmail.com>
Signed-off-by: Florian Mickler <florian@mickler.org>
Cc: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkpatch.pl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 36d6851f97d0..ddd27d8e6312 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -859,7 +859,7 @@ sub annotate_values { | |||
859 | $av_preprocessor = 0; | 859 | $av_preprocessor = 0; |
860 | } | 860 | } |
861 | 861 | ||
862 | } elsif ($cur =~ /^(\(\s*$Type\s*)\)/) { | 862 | } elsif ($cur =~ /^(\(\s*$Type\s*)\)/ && $av_pending eq '_') { |
863 | print "CAST($1)\n" if ($dbg_values > 1); | 863 | print "CAST($1)\n" if ($dbg_values > 1); |
864 | push(@av_paren_type, $type); | 864 | push(@av_paren_type, $type); |
865 | $type = 'C'; | 865 | $type = 'C'; |