Messages in this thread Patch in this message | | | Subject | [PATCH] checkpatch: extend line continuation test | From | Joe Perches <> | Date | Thu, 15 Nov 2012 22:21:13 -0800 |
| |
Preprocessor directives and asm statements should be allowed to have a line continuation.
Signed-off-by: Joe Perches <joe@perches.com> --- scripts/checkpatch.pl | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index d2d5ba1..019f9be 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3006,10 +3006,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);
| |