diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2014-08-06 19:10:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-06 21:01:27 -0400 |
commit | 048b123fad06f33169caa4afd6d56d58c31517e5 (patch) | |
tree | 3612541a4b6611bc599e8941c9e99c562a4abd2a | |
parent | 29ee1b0c67e0dd7dea8dd718e8326076bce5b6fe (diff) |
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 { | |||
3621 | # if should not continue a brace | 3621 | # if should not continue a brace |
3622 | if ($line =~ /}\s*if\b/) { | 3622 | if ($line =~ /}\s*if\b/) { |
3623 | ERROR("TRAILING_STATEMENTS", | 3623 | ERROR("TRAILING_STATEMENTS", |
3624 | "trailing statements should be on next line\n" . | 3624 | "trailing statements should be on next line (or did you mean 'else if'?)\n" . |
3625 | $herecurr); | 3625 | $herecurr); |
3626 | } | 3626 | } |
3627 | # case and default should not have general statements after them | 3627 | # case and default should not have general statements after them |