[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0708161201020.22579@kivilampi-30.cs.helsinki.fi>
Date: Thu, 16 Aug 2007 12:25:55 +0300 (EEST)
From: "Ilpo Järvinen" <ilpo.jarvinen@...sinki.fi>
To: David Miller <davem@...emloft.net>
cc: davej@...hat.com, Netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH] [IPv6]: Invalid semicolon after if statement
On Wed, 15 Aug 2007, David Miller wrote:
> From: Dave Jones <davej@...hat.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@...sinki.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@...sinki.fi>
> > >
> > > Yikes! Makes you want to audit the entire tree for these
> > > things :-)))
> >
> > Indeed. Here's another one.
> >
> > Signed-off-by: Dave Jones <davej@...hat.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.
Powered by blists - more mailing lists