summaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorAndy Whitcroft <apw@canonical.com>2012-03-23 23:02:18 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-24 00:58:36 +0100
commite45bab8ebfee65ba89b228c1e7c64a6cb0812124 (patch)
treefe61be22fa4438d5bd132712e730daca9cbf341b /scripts/checkpatch.pl
parentcheckpatch: allow simple character constants in #defines (diff)
downloadlinux-e45bab8ebfee65ba89b228c1e7c64a6cb0812124.tar.xz
linux-e45bab8ebfee65ba89b228c1e7c64a6cb0812124.zip
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@canonical.com> Cc: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 95ba30a24dcf..01a65988a057 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -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{
$Declare|
module_param_named|