From: Joe Perches Date: Mon, 13 Oct 2014 22:51:51 +0000 (-0700) Subject: checkpatch: add --strict test for concatenated string elements X-Git-Tag: v4.9.8~5526^2~110 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f17dba4fc0496eb0daf018074fccebdc85993c75;p=platform%2Fkernel%2Flinux-rpi3.git checkpatch: add --strict test for concatenated string elements Using a space between concatenated string elements is easier for a human to read. ie: "String"FOO"bar" is easier to read as: "String" FOO "bar" So suggest this style with a --strict command line option. Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 969b365f..9846dde 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -4344,6 +4344,12 @@ sub process { "Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt\n" . $herecurr); } +# concatenated string without spaces between elements + if ($line =~ /"X+"[A-Z_]+/ || $line =~ /[A-Z_]+"X+"/) { + CHK("CONCATENATED_STRING", + "Concatenated strings should use spaces between elements\n" . $herecurr); + } + # warn about #if 0 if ($line =~ /^.\s*\#\s*if\s+0\b/) { CHK("REDUNDANT_CODE",