public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Make checkpatch rant about trailing ; at the end of "if" expr
@ 2007-08-16  5:22 Eugene Teo
  2007-08-16  9:21 ` Andy Whitcroft
  0 siblings, 1 reply; 7+ messages in thread
From: Eugene Teo @ 2007-08-16  5:22 UTC (permalink / raw)
  To: apw; +Cc: linux-kernel, auke-jan.h.kok

Make checkpatch rant about trailing ; at the end of "if" expression.

Thanks to Auke for the regexp.

Signed-off by: Eugene Teo <eugeneteo@kernel.sg>

--- checkpatch.pl-0.09.default	2007-08-03 23:31:40.000000000 +0800
+++ checkpatch.pl-0.09	2007-08-16 13:18:40.000000000 +0800
@@ -1091,6 +1091,12 @@ sub process {
 				CHK("__setup appears un-documented -- check Documentation/kernel-parameters.txt\n" . $herecurr);
 			}
 		}
+
+# checks for trailing ; at the end of "if" expression
+		if ($line =~ /\bif\s*\([^\)]*\)\s*\;/) {
+			my $herevet = "$here\n" . cat_vet($line) . "\n";
+			ERROR("trailing ;\n" . $herevet);
+		}
 	}
 
 	if ($chk_patch && !$is_patch) {

^ permalink raw reply	[flat|nested] 7+ messages in thread
[parent not found: <8SGSb-2Kk-9@gated-at.bofh.it>]

end of thread, other threads:[~2007-08-22  9:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-16  5:22 [PATCH] Make checkpatch rant about trailing ; at the end of "if" expr Eugene Teo
2007-08-16  9:21 ` Andy Whitcroft
2007-08-17 12:03   ` Jan Engelhardt
     [not found] <8SGSb-2Kk-9@gated-at.bofh.it>
     [not found] ` <8SJQ6-7pj-13@gated-at.bofh.it>
     [not found]   ` <8T8Oy-3D0-13@gated-at.bofh.it>
2007-08-20 11:52     ` Bodo Eggert
2007-08-20 12:44       ` Jan Engelhardt
2007-08-22  9:21         ` Bodo Eggert
2007-08-22  9:57           ` Jan Engelhardt

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