[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131102150520.GV15704@leaf>
Date: Sat, 2 Nov 2013 08:05:20 -0700
From: Josh Triplett <josh@...htriplett.org>
To: Julia Lawall <julia.lawall@...6.fr>
Cc: Gilles Muller <Gilles.Muller@...6.fr>,
Nicolas Palix <nicolas.palix@...g.fr>,
Michal Marek <mmarek@...e.cz>, linux-kernel@...r.kernel.org,
cocci@...teme.lip6.fr
Subject: Re: [PATCH] coccinelle: Add a script to find and remove unnecessary
ifs with no body
On Sat, Nov 02, 2013 at 03:51:50PM +0100, Julia Lawall wrote:
> On Sat, 2 Nov 2013, Josh Triplett wrote:
>
> > This script matches code like:
> >
> > if (foo) {}
> >
> > and either eliminates it (if foo has no side effects) or replaces it
> > with foo (if foo has side effects).
> >
> > Works perfectly in report mode; the results of patch mode are
> > semantically correct but may still benefit from further simplification.
>
> Actually, I would get rid of the patch mode. Looking through some of the
> results, I don't see any where just deleting the code is the right thing
> to do. They all look like cases where the developer wanted to remember to
> think more about the problem.
I observed several where the patch seemed entirely correct, with no
FIXME/TODO/XXX comments associated with the conditional.
Nonetheless, I don't mind removing the patch mode if you don't think
it's worthwhile. I'll send a v2.
- Josh Triplett
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists