Skip to content

Commit 3f7f335

Browse files
JoePerchestorvalds
authored andcommitted
checkpatch: improve quoted string and line continuation test
Given this patch context, +#define EFI_ST_DISK_IMG { \ + 0x00000240, "\xbe\x5b\x7c\xac\x22\xc0\x74\x0b" /* .[|.".t. */ \ + } the current code misreports a quoted string line continuation defect as there is a single quote in comment. The 'raw' line should not be tested for quote count, the comment substituted line should be instead. Link: http://lkml.kernel.org/r/13f2735df10c33ca846e26f42f5cce6618157200.1513698599.git.joe@perches.com Signed-off-by: Joe Perches <[email protected]> Reported-by: Heinrich Schuchardt <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 7312153 commit 3f7f335

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/checkpatch.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5312,7 +5312,7 @@ sub process {
53125312
}
53135313

53145314
# check for line continuations in quoted strings with odd counts of "
5315-
if ($rawline =~ /\\$/ && $rawline =~ tr/"/"/ % 2) {
5315+
if ($rawline =~ /\\$/ && $sline =~ tr/"/"/ % 2) {
53165316
WARN("LINE_CONTINUATIONS",
53175317
"Avoid line continuations in quoted strings\n" . $herecurr);
53185318
}

0 commit comments

Comments
 (0)