summaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorRasmus Villemoes2014-08-07 01:10:37 +0200
committerLinus Torvalds2014-08-07 03:01:27 +0200
commit048b123fad06f33169caa4afd6d56d58c31517e5 (patch)
tree3612541a4b6611bc599e8941c9e99c562a4abd2a /scripts/checkpatch.pl
parentcheckpatch: ignore email headers better (diff)
downloadkernel-qcow2-linux-048b123fad06f33169caa4afd6d56d58c31517e5.tar.gz
kernel-qcow2-linux-048b123fad06f33169caa4afd6d56d58c31517e5.tar.xz
kernel-qcow2-linux-048b123fad06f33169caa4afd6d56d58c31517e5.zip
checkpatch.pl: also suggest 'else if' when if follows brace
This might help a kernel hacker think twice before blindly adding a newline. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Acked-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 1ec68083a929..c40ba40cef43 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3621,7 +3621,7 @@ sub process {
# if should not continue a brace
if ($line =~ /}\s*if\b/) {
ERROR("TRAILING_STATEMENTS",
- "trailing statements should be on next line\n" .
+ "trailing statements should be on next line (or did you mean 'else if'?)\n" .
$herecurr);
}
# case and default should not have general statements after them