[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.1910202227480.10441@hadrien>
Date: Sun, 20 Oct 2019 22:29:35 +0200 (CEST)
From: Julia Lawall <julia.lawall@...6.fr>
To: Joe Perches <joe@...ches.com>
cc: Dan Carpenter <dan.carpenter@...cle.com>,
Jules Irenge <jbi.octave@...il.com>,
devel@...verdev.osuosl.org, outreachy-kernel@...glegroups.com,
linux-kernel@...r.kernel.org, gregkh@...uxfoundation.org
Subject: Re: [Outreachy kernel] Re: [PATCH v1 1/5] staging: wfx: fix warnings
of no space is necessary
On Sun, 20 Oct 2019, Joe Perches wrote:
> On Sun, 2019-10-20 at 21:52 +0200, Julia Lawall wrote:
> > On Sun, 20 Oct 2019, Joe Perches wrote:
> []
> > > There's probably a generic cocci mechanism to check function
> > > prototypes and then remove uses of unnecessary void pointer casts
> > > in function calls. I'm not going to try to figure out that syntax.
> >
> > With the --recursive-includes option, perhaps:
> >
> > @r@
> > identifier f;
> > parameter list[n] ps;
> > type T;
> > identifier i;
> > @@
> >
> > T f(ps, void *i, ...);
> >
> > @@
> > expression e;
> > identifier r.f;
> > expression list[r.n] es;
> > @@
> >
> > f(es,
> > - (void *)(e)
> > + e
> > ,...)
> >
> > This of course only works for functions that have prototypes, and not for
> > macros. It will also run slowly.
>
> You are not kidding about slow, but it doesn't seem to work
> for mem<foo>, maybe because system includes aren't analyzed.
No they are not.
> Single file processing time on an XPS13 averages more than
> 100 seconds per file.
Not surprising.
Actually, --include-headers-for-types should provide some benefit. That
discards the header files after the type inference.
> Also:
>
> expression e;
>
> could probably be better as:
>
> type T;
> T *p;
Good point. expression *e; would be sufficient.
julia
>
> as some of the expressions cast to void are int or size_t
> and it's probably better to restrict the conversions to
> just pointer or array types.
>
>
>
Powered by blists - more mailing lists