[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1330605850-7873-4-git-send-email-apw@canonical.com>
Date: Thu, 1 Mar 2012 12:44:08 +0000
From: Andy Whitcroft <apw@...onical.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Joe Perches <joe@...ches.com>, linux-kernel@...r.kernel.org,
Andy Whitcroft <apw@...onical.com>
Subject: [PATCH 3/5] checkpatch: handle string concatenation in simple #defines
Adjacent strings indicate concatentation, therefore look at identifiers
directly adjacent to literal strings as strings too. This allows us to
better detect the form below and accept it as a simple constant:
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Signed-off-by: Andy Whitcroft <apw@...onical.com>
---
scripts/checkpatch.pl | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index ff8a84f..35189de 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2828,6 +2828,12 @@ sub process {
{
}
+ # Flatten any obvious string concatentation.
+ while ($dstat =~ s/("X*")\s*$Ident/$1/ ||
+ $dstat =~ s/$Ident\s*("X*")/$1/)
+ {
+ }
+
my $exceptions = qr{
$Declare|
module_param_named|
--
1.7.9
--
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