All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts/checkpatch.pl: added test for repeated lines
@ 2011-07-10 18:18 Edwin van Vliet
  2011-07-10 18:49 ` Joe Perches
  0 siblings, 1 reply; 4+ messages in thread
From: Edwin van Vliet @ 2011-07-10 18:18 UTC (permalink / raw)
  To: apw; +Cc: linux-kernel, Edwin van Vliet

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-07-10 22:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-10 18:18 [PATCH] scripts/checkpatch.pl: added test for repeated lines Edwin van Vliet
2011-07-10 18:49 ` Joe Perches
2011-07-10 20:23   ` Edwin van Vliet
2011-07-10 22:35     ` Joe Perches

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.