checkpatch: add check for line continuations in quoted strings
[firefly-linux-kernel-4.4.55.git] / scripts / checkpatch.pl
index d8670810db65f664623a18f991a88a7a72a00d5b..5c9672951077836a483e2e11db12efbf1dc5b524 100755 (executable)
@@ -2748,6 +2748,11 @@ sub process {
                        WARN("sizeof(& should be avoided\n" . $herecurr);
                }
 
+# check for line continuations in quoted strings with odd counts of "
+               if ($rawline =~ /\\$/ && $rawline =~ tr/"/"/ % 2) {
+                       WARN("Avoid line continuations in quoted strings\n" . $herecurr);
+               }
+
 # check for new externs in .c files.
                if ($realfile =~ /\.c$/ && defined $stat &&
                    $stat =~ /^.\s*(?:extern\s+)?$Type\s+($Ident)(\s*)\(/s)