From: Edwin van Vliet <edwin@cheatah.nl>
To: apw@canonical.com
Cc: linux-kernel@vger.kernel.org, Edwin van Vliet <edwin@cheatah.nl>
Subject: [PATCH] scripts/checkpatch.pl: added test for repeated lines
Date: Sun, 10 Jul 2011 20:18:09 +0200 [thread overview]
Message-ID: <1310321889-25943-1-git-send-email-edwin@cheatah.nl> (raw)
Repeated lines may indicate a bug or code that needs clarification. If the
repeated line is intentional, an extra comment may be helpful for reviewers
since the repeated pattern is likely to draw attention.
Signed-off-by: Edwin van Vliet <edwin@cheatah.nl>
---
scripts/checkpatch.pl | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index b0aa2c6..4b50496 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1479,6 +1479,11 @@ sub process {
WARN("adding a line without newline at end of file\n" . $herecurr);
}
+# check for repeated lines which may indicate bugs or lack of clarity
+ if ($rawline eq $prevrawline) {
+ WARN("repeated line\n" . $herecurr);
+ }
+
# Blackfin: use hi/lo macros
if ($realfile =~ m@arch/blackfin/.*\.S$@) {
if ($line =~ /\.[lL][[:space:]]*=.*&[[:space:]]*0x[fF][fF][fF][fF]/) {
--
1.7.5.4
next reply other threads:[~2011-07-10 18:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-10 18:18 Edwin van Vliet [this message]
2011-07-10 18:49 ` Joe Perches
2011-07-10 20:23 ` Edwin van Vliet
2011-07-10 22:35 ` Joe Perches
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=1310321889-25943-1-git-send-email-edwin@cheatah.nl \
--to=edwin@cheatah.nl \
--cc=apw@canonical.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®