From: Rasmus Villemoes Date: Wed, 6 Aug 2014 23:10:37 +0000 (-0700) Subject: checkpatch.pl: also suggest 'else if' when if follows brace X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=048b123fad06f33169caa4afd6d56d58c31517e5;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Acked-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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