From: "Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi>
To: David Miller <davem@davemloft.net>
Cc: davej@redhat.com, Netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH] [IPv6]: Invalid semicolon after if statement
Date: Thu, 16 Aug 2007 12:25:55 +0300 (EEST) [thread overview]
Message-ID: <Pine.LNX.4.64.0708161201020.22579@kivilampi-30.cs.helsinki.fi> (raw)
In-Reply-To: <20070815.175128.82362004.davem@davemloft.net>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1996 bytes --]
On Wed, 15 Aug 2007, David Miller wrote:
> From: Dave Jones <davej@redhat.com>
> Date: Wed, 15 Aug 2007 19:52:20 -0400
>
> > On Wed, Aug 15, 2007 at 03:08:14PM -0700, David Miller wrote:
> > > From: "Ilpo_Järvinen" <ilpo.jarvinen@helsinki.fi>
> > > Date: Thu, 16 Aug 2007 00:57:00 +0300 (EEST)
> > >
> > > > A similar fix to netfilter from Eric Dumazet inspired me to
> > > > look around a bit by using some grep/sed stuff as looking for
> > > > this kind of bugs seemed easy to automate. This is one of them
> > > > I found where it looks like this semicolon is not valid.
> > > >
> > > > Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
> > >
> > > Yikes! Makes you want to audit the entire tree for these
> > > things :-)))
> >
> > Indeed. Here's another one.
> >
> > Signed-off-by: Dave Jones <davej@redhat.com>
>
> That got fixed the other day and is the "A similar fix to netfilter
> from Eric Dumazet" Ilpo is reffering to above :)
...heh, when I said "a bit", I meant that it took a very little effort
to check over the whole tree... :-)
...I've already reported all four things one could find from whole tree
with this cmd (to the relevant parties), so no need for you to redo the
effort :-) :
$ for i in `find . -name '*.[ch]'`; do echo $i;
sed -n -e '/^\t*if *[(].*[)] *; *$/ N'
-e '/^\(\t*\)if *[(].*[)] *; *\n\1\t/ p' $i; done | tee result
...Basically it checks if the next line has more indentation than the
if line. ...Obviously it will work only if the code follows current
CodingStyle in indentation. I'm currently experimenting with indent
preprocessing step... ...but I'm not yet sure if I can pull something
useful out from that too :-)
...Better cmdlines could be invented, e.g. by manually checking every "if
();" lines once one has first automated separation of them from "if ()
do_smthg();" lines (I haven't learned myself how to easily count/work with
parenthesis pairs in a cmdline, which seems necessary here)...
--
i.
prev parent reply other threads:[~2007-08-16 9:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-15 21:57 [PATCH] [IPv6]: Invalid semicolon after if statement Ilpo Järvinen
2007-08-15 22:08 ` David Miller
2007-08-15 23:52 ` Dave Jones
2007-08-16 0:51 ` David Miller
2007-08-16 9:25 ` Ilpo Järvinen [this message]
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=Pine.LNX.4.64.0708161201020.22579@kivilampi-30.cs.helsinki.fi \
--to=ilpo.jarvinen@helsinki.fi \
--cc=davej@redhat.com \
--cc=davem@davemloft.net \
--cc=netdev@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;
as well as URLs for NNTP newsgroup(s).