diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2014-08-06 16:10:37 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-06 18:01:27 -0700 |
commit | 048b123fad06f33169caa4afd6d56d58c31517e5 (patch) | |
tree | 3612541a4b6611bc599e8941c9e99c562a4abd2a | |
parent | 29ee1b0c67e0dd7dea8dd718e8326076bce5b6fe (diff) | |
download | lwn-048b123fad06f33169caa4afd6d56d58c31517e5.tar.gz lwn-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>
-rwxr-xr-x | scripts/checkpatch.pl | 2 |
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 |