Messages in this thread Patch in this message | | | From | Andy Whitcroft <> | Subject | [PATCH 3/5] checkpatch: handle string concatenation in simple #defines | Date | Thu, 1 Mar 2012 12:44:08 +0000 |
| |
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
| |