Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f17dba4f authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds
Browse files

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: default avatarJoe 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 56193274
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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",