projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7312153
)
checkpatch: improve quoted string and line continuation test
author
Joe Perches
<
[email protected]
>
Tue, 6 Feb 2018 23:38:52 +0000
(15:38 -0800)
committer
Linus Torvalds
<
[email protected]
>
Wed, 7 Feb 2018 02:32:45 +0000
(18:32 -0800)
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]
>
scripts/checkpatch.pl
patch
|
blob
|
history
diff --git
a/scripts/checkpatch.pl
b/scripts/checkpatch.pl
index 168687ae24fa09bdaf5b47b65f95acd3ec2e80a2..7c635146cb80c6f4861df2a8c96cb7aab9a855cc 100755
(executable)
--- a/
scripts/checkpatch.pl
+++ b/
scripts/checkpatch.pl
@@
-5312,7
+5312,7
@@
sub process {
}
# check for line continuations in quoted strings with odd counts of "
- if ($rawline =~ /\\$/ && $
raw
line =~ tr/"/"/ % 2) {
+ if ($rawline =~ /\\$/ && $
s
line =~ tr/"/"/ % 2) {
WARN("LINE_CONTINUATIONS",
"Avoid line continuations in quoted strings\n" . $herecurr);
}