[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20221110150729.afctso5mtl3y5lf4@pengutronix.de>
Date: Thu, 10 Nov 2022 16:07:29 +0100
From: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To: Julia Lawall <julia.lawall@...ia.fr>
Cc: Nicolas Palix <nicolas.palix@...g.fr>,
linux-kernel@...r.kernel.org, kernel@...gutronix.de, cocci@...ia.fr
Subject: Re: [PATCH v2] coccinelle: api: Don't use
devm_platform_get_and_ioremap_resource with res==NULL
Hello,
On Mon, Nov 07, 2022 at 07:11:35PM +0100, Uwe Kleine-König wrote:
> devm_platform_get_and_ioremap_resource(pdev, index, NULL) is equivalent to
> the shorter devm_platform_ioremap_resource(pdev, index).
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
> ---
> On Mon, Nov 07, 2022 at 08:45:38PM +0800, Julia Lawall wrote:
> > On Mon, 7 Nov 2022, Uwe Kleine-König wrote:
> >
> > > devm_platform_get_and_ioremap_resource(pdev, index, NULL) is equivalent to
> > > the shorter devm_platform_ioremap_resource(pdev, index).
> > >
> > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
> > > ---
> > > Hello,
> > >
> > > a potential improvement is to check for invocations of
> > > devm_platform_get_and_ioremap_resource() where the res parameter isn't
> > > used afterwards, but my coccinelle foo isn't strong enough for that.
> >
> > ... when != res
> >
> > I'm not sure where you wanted to put it though.
>
> I tinkered a bit further and even succeeded to remove the declaration if
> it's otherwise unused.
>
> I failed to test the report mode, my spatch tells me some error about
> python2?!
For the record, that is a problem with Debian's coccinelle, bugreport
at https://bugs.debian.org/1023653
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists