Elyes Haouas has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/63579 )
Change subject: util/lint/checkpatch.pl: Update to v5.18-2 lines related to TYPECAST_INT_CONSTANT ......................................................................
util/lint/checkpatch.pl: Update to v5.18-2 lines related to TYPECAST_INT_CONSTANT
Signed-off-by: Elyes Haouas ehaouas@noos.fr Change-Id: I8ed89e53f647b1b071abff33a434fb3b8dbb1de1 --- M util/lint/checkpatch.pl 1 file changed, 10 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/79/63579/1
diff --git a/util/lint/checkpatch.pl b/util/lint/checkpatch.pl index eccbffc..a748d36 100755 --- a/util/lint/checkpatch.pl +++ b/util/lint/checkpatch.pl @@ -6068,18 +6068,18 @@ if ($line =~ /((\s*$C90_int_types\s*)\s*)($Constant)\b/) { my $cast = $1; my $const = $2; + my $suffix = ""; + my $newconst = $const; + $newconst =~ s/${Int_type}$//; + $suffix .= 'U' if ($cast =~ /\bunsigned\b/); + if ($cast =~ /\blong\s+long\b/) { + $suffix .= 'LL'; + } elsif ($cast =~ /\blong\b/) { + $suffix .= 'L'; + } if (WARN("TYPECAST_INT_CONSTANT", - "Unnecessary typecast of c90 int constant\n" . $herecurr) && + "Unnecessary typecast of c90 int constant - '$cast$const' could be '$const$suffix'\n" . $herecurr) && $fix) { - my $suffix = ""; - my $newconst = $const; - $newconst =~ s/${Int_type}$//; - $suffix .= 'U' if ($cast =~ /\bunsigned\b/); - if ($cast =~ /\blong\s+long\b/) { - $suffix .= 'LL'; - } elsif ($cast =~ /\blong\b/) { - $suffix .= 'L'; - } $fixed[$fixlinenr] =~ s/\Q$cast\E$const\b/$newconst$suffix/; } }