]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
checkpatch: warn on unnecessary spaces before quoted newlines
authorJoe Perches <joe@perches.com>
Fri, 5 Mar 2010 21:43:55 +0000 (13:43 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 6 Mar 2010 19:26:44 +0000 (11:26 -0800)
Signed-off-by: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/checkpatch.pl

index cf4e44cf3c27d5cc4758ab082ad26bd2aef0f903..a4d74344d805610a67e0e7e0bbf1674875f555a7 100755 (executable)
@@ -1394,6 +1394,11 @@ sub process {
                        WARN("line over 80 characters\n" . $herecurr);
                }
 
+# check for spaces before a quoted newline
+               if ($rawline =~ /^.*\".*\s\\n/) {
+                       WARN("unnecessary whitespace before a quoted newline\n" . $herecurr);
+               }
+
 # check for adding lines without a newline.
                if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) {
                        WARN("adding a line without newline at end of file\n" . $herecurr);