Commit 481eb486 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

checkpatch: extend line continuation test

Preprocessor directives and asm statements should be allowed to have a
line continuation.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Tested-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6cd7f386
......@@ -3009,10 +3009,12 @@ sub process {
}
}
# check for line continuations outside of #defines
# check for line continuations outside of #defines, preprocessor #, and asm
} else {
if ($prevline !~ /^..*\\$/ &&
$line !~ /^\+\s*\#.*\\$/ && # preprocessor
$line !~ /^\+.*\b(__asm__|asm)\b.*\\$/ && # asm
$line =~ /^\+.*\\$/) {
WARN("LINE_CONTINUATIONS",
"Avoid unnecessary line continuations\n" . $herecurr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment