]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
checkpatch: extend line continuation test
authorJoe Perches <joe@perches.com>
Tue, 18 Dec 2012 00:01:56 +0000 (16:01 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 18 Dec 2012 01:15:19 +0000 (17:15 -0800)
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>
scripts/checkpatch.pl

index 6fa167758f82b43cef61c8343d9b526346de909c..3e9fee60642cd0ddf648602ffb243a0a70fc7bad 100755 (executable)
@@ -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 !~ /^..*\\$/ &&
 
                } else {
                        if ($prevline !~ /^..*\\$/ &&
+                           $line !~ /^\+\s*\#.*\\$/ &&         # preprocessor
+                           $line !~ /^\+.*\b(__asm__|asm)\b.*\\$/ &&   # asm
                            $line =~ /^\+.*\\$/) {
                                WARN("LINE_CONTINUATIONS",
                                     "Avoid unnecessary line continuations\n" . $herecurr);
                            $line =~ /^\+.*\\$/) {
                                WARN("LINE_CONTINUATIONS",
                                     "Avoid unnecessary line continuations\n" . $herecurr);