mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-09 23:00:21 +00:00
checkpatch: extend line continuation test
Preprocessor directives and asm statements should be allowed to have a line continuation. Signed-off-by: Joe Perches <joe@perches.com> Tested-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
6cd7f3869c
commit
481eb486a8
@ -3009,10 +3009,12 @@ sub process {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# check for line continuations outside of #defines
|
# check for line continuations outside of #defines, preprocessor #, and asm
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if ($prevline !~ /^..*\\$/ &&
|
if ($prevline !~ /^..*\\$/ &&
|
||||||
|
$line !~ /^\+\s*\#.*\\$/ && # preprocessor
|
||||||
|
$line !~ /^\+.*\b(__asm__|asm)\b.*\\$/ && # asm
|
||||||
$line =~ /^\+.*\\$/) {
|
$line =~ /^\+.*\\$/) {
|
||||||
WARN("LINE_CONTINUATIONS",
|
WARN("LINE_CONTINUATIONS",
|
||||||
"Avoid unnecessary line continuations\n" . $herecurr);
|
"Avoid unnecessary line continuations\n" . $herecurr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user