lint/checkpatch: Update 'uncoalesced string fragments'

This reduce the difference with linux v5.19-rc7.

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Change-Id: I21b2a0d87cbf610fc48e273ed78ab779ad4a6932
Reviewed-on: https://review.coreboot.org/c/coreboot/+/65832
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@tutanota.com>
This commit is contained in:
Elyes Haouas 2022-07-13 16:52:48 +02:00 committed by Martin L Roth
parent 71bfcf528d
commit e235a0de18
1 changed files with 9 additions and 3 deletions

View File

@ -5720,9 +5720,15 @@ sub process {
} }
# uncoalesced string fragments # uncoalesced string fragments
if ($line =~ /$String\s*"/) { if ($line =~ /$String\s*[Lu]?"/) {
WARN("STRING_FRAGMENTS", if (WARN("STRING_FRAGMENTS",
"Consecutive strings are generally better as a single string\n" . $herecurr); "Consecutive strings are generally better as a single string\n" . $herecurr) &&
$fix) {
while ($line =~ /($String)(?=\s*")/g) {
my $extracted_string = substr($rawline, $-[0], $+[0] - $-[0]);
$fixed[$fixlinenr] =~ s/\Q$extracted_string\E\s*"/substr($extracted_string, 0, -1)/e;
}
}
} }
# check for non-standard and hex prefixed decimal printf formats # check for non-standard and hex prefixed decimal printf formats