aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-12-17 19:01:56 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-17 20:15:19 -0500
commit481eb486a88c9b068f0168ac4c21291802720933 (patch)
treeded9373e9ace9887f28c8bf3ea1810c600a6b059 /scripts/checkpatch.pl
parent6cd7f3869c925622bbf420e1107a026d91dbd7f2 (diff)
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>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 6fa167758f82..3e9fee60642c 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3009,10 +3009,12 @@ sub process {
3009 } 3009 }
3010 } 3010 }
3011 3011
3012# check for line continuations outside of #defines 3012# check for line continuations outside of #defines, preprocessor #, and asm
3013 3013
3014 } else { 3014 } else {
3015 if ($prevline !~ /^..*\\$/ && 3015 if ($prevline !~ /^..*\\$/ &&
3016 $line !~ /^\+\s*\#.*\\$/ && # preprocessor
3017 $line !~ /^\+.*\b(__asm__|asm)\b.*\\$/ && # asm
3016 $line =~ /^\+.*\\$/) { 3018 $line =~ /^\+.*\\$/) {
3017 WARN("LINE_CONTINUATIONS", 3019 WARN("LINE_CONTINUATIONS",
3018 "Avoid unnecessary line continuations\n" . $herecurr); 3020 "Avoid unnecessary line continuations\n" . $herecurr);