lkml.org 
[lkml]   [2012]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/5] checkpatch: handle string concatenation in simple #defines
Date
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@canonical.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


\
 
 \ /
  Last update: 2012-03-01 13:47    [W:0.083 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site