Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c023e473 authored by Florian Mickler's avatar Florian Mickler Committed by Linus Torvalds
Browse files

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: default avatarAudun Hoem <audun.hoem@gmail.com>
Signed-off-by: default avatarFlorian Mickler <florian@mickler.org>
Cc: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent caf2a54f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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';