[PATCH] Make checkpatch rant about trailing ; at the end of "if" expr

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <apw@...>
Cc: <linux-kernel@...>, <auke-jan.h.kok@...>
Date: Thursday, August 16, 2007 - 1:22 am

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) {
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Make checkpatch rant about trailing ; at the end of ..., Eugene Teo, (Thu Aug 16, 1:22 am)