Commit e45bab8e authored by Andy Whitcroft's avatar Andy Whitcroft Committed by Linus Torvalds

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: default avatarAndy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b9df76ac
...@@ -2894,6 +2894,12 @@ sub process { ...@@ -2894,6 +2894,12 @@ sub process {
{ {
} }
# Flatten any obvious string concatentation.
while ($dstat =~ s/("X*")\s*$Ident/$1/ ||
$dstat =~ s/$Ident\s*("X*")/$1/)
{
}
my $exceptions = qr{ my $exceptions = qr{
$Declare| $Declare|
module_param_named| module_param_named|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment