[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1351399596.13495.3.camel@joe-AO722>
Date: Sat, 27 Oct 2012 21:46:36 -0700
From: Joe Perches <joe@...ches.com>
To: Peter Hurley <peter@...leysoftware.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Andy Whitcroft <apw@...onical.com>,
David Howells <dhowells@...hat.com>,
Ken O'Brien <kernel@...obrien.org>, gregkh@...uxfoundation.org,
swetland@...gle.com, arve@...roid.com, viro@...iv.linux.org.uk,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2] checkpatch: Warn on unnecessary line continuations
When the previous line is not a line continuation and the
current line has a line continuation but is not a #define,
emit a warning.
Signed-off-by: Joe Perches <joe@...ches.com>
---
scripts/checkpatch.pl | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index f18750e..d4f61a6 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3013,6 +3013,15 @@ sub process {
"Macros with complex values should be enclosed in parenthesis\n" . "$herectx");
}
}
+
+# check for line continuations outside of #defines
+
+ } else {
+ if ($prevline !~ /^..*\\$/ &&
+ $line =~ /^\+.*\\$/) {
+ WARN("LINE_CONTINUATIONS",
+ "Avoid unnecessary line continuations\n" . $herecurr);
+ }
}
# do {} while (0) macro tests:
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists