From: Eugene Teo <eugeneteo@kernel.sg>
To: apw@shadowen.org
Cc: linux-kernel@vger.kernel.org, auke-jan.h.kok@intel.com
Subject: [PATCH] Make checkpatch rant about trailing ; at the end of "if" expr
Date: Thu, 16 Aug 2007 13:22:15 +0800 [thread overview]
Message-ID: <20070816052215.GA3857@kernel.sg> (raw)
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) {
next reply other threads:[~2007-08-16 6:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-16 5:22 Eugene Teo [this message]
2007-08-16 9:21 ` [PATCH] Make checkpatch rant about trailing ; at the end of "if" expr 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070816052215.GA3857@kernel.sg \
--to=eugeneteo@kernel.sg \
--cc=apw@shadowen.org \
--cc=auke-jan.h.kok@intel.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox