Commit 5e79d96eed306a8b4af67b3f35f6867edfabeebc

Authored by Joe Perches
Committed by Linus Torvalds
1 parent 08e4436566

checkpatch: warn on unnecessary spaces before quoted newlines

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>

Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff

scripts/checkpatch.pl
... ... @@ -1394,6 +1394,11 @@
1394 1394 WARN("line over 80 characters\n" . $herecurr);
1395 1395 }
1396 1396  
  1397 +# check for spaces before a quoted newline
  1398 + if ($rawline =~ /^.*\".*\s\\n/) {
  1399 + WARN("unnecessary whitespace before a quoted newline\n" . $herecurr);
  1400 + }
  1401 +
1397 1402 # check for adding lines without a newline.
1398 1403 if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) {
1399 1404 WARN("adding a line without newline at end of file\n" . $herecurr);