Re: [PATCH RFC V2] coccinelle: flag constants being passed for jiffies

From: Nicholas Mc Guire
Date: Sun Jun 14 2015 - 03:35:11 EST


On Sun, 14 Jun 2015, Julia Lawall wrote:

> > +@script:python depends on report@
> > +p << cc.p;
> > +timeout << cc.C;
> > +@@
> > +
> > +if str.isdigit(timeout):
> > + if (int(timeout) != 1):
> > + msg = "WARNING: timeout (%s) seems HZ dependent" % (timeout)
> > + coccilib.report.print_report(p[0], msg)
>
> The parentheses in the warning messages around the timeouts seem a little
> strange to me.
>

should be \"%s\" I guess - will fix that and the other findings - just waiting
for feedback if it makes any sense at all to include something like this.

> Otherwise, as a semantic patch, it looks fine. I can't judge the problem
> being solved though.
>
it found aproximately 30 cases in the kernel some of which have been fixed
already and none seem to be false postitives - the hardcoded "2"
really being the only open issue if those should be counted as false-postitives
and filtered.

I'm not aware of any case in the kernel where the passing of a jiffies value
is intentionally HZ dependent - so I guess atleast warning on this
makes sense.

Anyway it might also make more sense to put something like this
into one of the build-bots rather than push it into mainline for general
use.

thx!
hofrat
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/