diff options
author | Elyes Haouas <ehaouas@noos.fr> | 2022-07-13 16:51:20 +0200 |
---|---|---|
committer | Martin L Roth <gaumless@tutanota.com> | 2022-07-19 01:47:17 +0000 |
commit | 71bfcf528dd54329db4466f11ae91f8d3a33adaf (patch) | |
tree | 9981129191db541125ab6f960d0790515520719c /util | |
parent | a59a87ca17ff6fd2933c26043e78ac9e4fb3fa5d (diff) |
lint/checkpatch: Update 'concatenated string without spaces between elements'
This reduce the difference with linux v5.19-rc7.
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Change-Id: I04e58aca4a30e82f3da0cda08403d0daf3b5fb10
Reviewed-on: https://review.coreboot.org/c/coreboot/+/65831
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@tutanota.com>
Diffstat (limited to 'util')
-rwxr-xr-x | util/lint/checkpatch.pl | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/util/lint/checkpatch.pl b/util/lint/checkpatch.pl index 577bdfa1a2..72c0f365d9 100755 --- a/util/lint/checkpatch.pl +++ b/util/lint/checkpatch.pl @@ -5706,9 +5706,17 @@ sub process { } # concatenated string without spaces between elements - if ($line =~ /$String[A-Z_]/ || $line =~ /[A-Za-z0-9_]$String/) { - CHK("CONCATENATED_STRING", - "Concatenated strings should use spaces between elements\n" . $herecurr); + if ($line =~ /$String[A-Z_]/ || + ($line =~ /([A-Za-z0-9_]+)$String/ && $1 !~ /^[Lu]$/)) { + if (CHK("CONCATENATED_STRING", + "Concatenated strings should use spaces between elements\n" . $herecurr) && + $fix) { + while ($line =~ /($String)/g) { + my $extracted_string = substr($rawline, $-[0], $+[0] - $-[0]); + $fixed[$fixlinenr] =~ s/\Q$extracted_string\E([A-Za-z0-9_])/$extracted_string $1/; + $fixed[$fixlinenr] =~ s/([A-Za-z0-9_])\Q$extracted_string\E/$1 $extracted_string/; + } + } } # uncoalesced string fragments |