aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-03-05 16:43:55 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-06 14:26:44 -0500
commit5e79d96eed306a8b4af67b3f35f6867edfabeebc (patch)
treefdd6da6cc21c874b386e40ac9d7e5b8de6441cb9
parent08e4436566250cb98b3f3ac37643b1cf09481256 (diff)
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>
-rwxr-xr-xscripts/checkpatch.pl5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index cf4e44cf3c27..a4d74344d805 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1394,6 +1394,11 @@ sub process {
1394 WARN("line over 80 characters\n" . $herecurr); 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# check for adding lines without a newline. 1402# check for adding lines without a newline.
1398 if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) { 1403 if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) {
1399 WARN("adding a line without newline at end of file\n" . $herecurr); 1404 WARN("adding a line without newline at end of file\n" . $herecurr);