[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1330667673.1939.22.camel@joe2Laptop>
Date: Thu, 01 Mar 2012 21:54:33 -0800
From: Joe Perches <joe@...ches.com>
To: David Miller <davem@...emloft.net>,
Andy Whitcroft <apw@...dowen.org>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: Dan Carpenter <dan.carpenter@...cle.com>, gustavo@...ovan.org,
johan.hedberg@...il.com, linville@...driver.com,
netdev@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] checkpatch: Add --strict test for strings split across
multiple lines
Strings split across multiple lines are commonly used
as formats. These uncoalesced formats are hard to grep
and are relatively error prone.
Suggest coalescing split strings when using --strict.
Signed-off-by: Joe Perches <joe@...ches.com>
---
scripts/checkpatch.pl | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 581a14c..5d0b46c 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1860,6 +1860,12 @@ sub process {
"Don't begin block comments with only a /* line, use /* comment...\n" . $hereprev);
}
+ if ($prevline =~ /^\+.*"[ \t]*$/ &&
+ $line =~ /^\+[ \t]*"/) {
+ CHK("COALESCE_STRING",
+ "Coalesced strings are easier to grep and less error prone\n" . $hereprev);
+ }
+
# check for spaces at the beginning of a line.
# Exceptions:
# 1) within comments
--
1.7.8.111.gad25c.dirty
--
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