mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] checkpatch.pl: Also suggest 'else if' when if follows brace
@ 2014-06-20 20:04 Rasmus Villemoes
  2014-06-20 20:18 ` Joe Perches
  0 siblings, 1 reply; 2+ messages in thread
From: Rasmus Villemoes @ 2014-06-20 20:04 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches; +Cc: linux-kernel, Rasmus Villemoes

This might help a kernel hacker think twice before blindly adding a
newline.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 010b18e..e1924eb 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3601,7 +3601,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
-- 
1.9.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-06-20 20:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-20 20:04 [PATCH] checkpatch.pl: Also suggest 'else if' when if follows brace Rasmus Villemoes
2014-06-20 20:18 ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®