From: Joe Perches <joe@perches.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Jingoo Han <jg1.han@samsung.com>,
Andy Whitcroft <apw@canonical.com>,
peter@hurleysoftware.com, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH V2] checkpatch: extend line continuation test
Date: Fri, 16 Nov 2012 11:31:11 -0800 [thread overview]
Message-ID: <1353094271.2512.15.camel@joe-AO722> (raw)
In-Reply-To: <1353046873.24310.30.camel@joe-AO722>
Preprocessor directives and asm statements should be
allowed to have a line continuation.
Signed-off-by: Joe Perches <joe@perches.com>
---
V2:
Make the check for preprocessor directives work properly
# is not optional.
scripts/checkpatch.pl | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d2d5ba1..bfb06ee 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);
next prev parent reply other threads:[~2012-11-16 19:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20121030211530.09F1320004E@hpza10.eem.corp.google.com>
2012-11-16 6:21 ` [PATCH] checkpatch: extend line continuation test Joe Perches
2012-11-16 6:28 ` Jingoo Han
2012-11-16 7:02 ` Geert Uytterhoeven
2012-11-16 7:09 ` Joe Perches
2012-11-16 19:31 ` Joe Perches [this message]
2012-11-19 1:06 ` [PATCH V2] " Jingoo Han
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1353094271.2512.15.camel@joe-AO722 \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=apw@canonical.com \
--cc=jg1.han@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peter@hurleysoftware.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox