[<prev] [next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.22.394.2009071544460.2476@hadrien>
Date: Mon, 7 Sep 2020 15:46:44 +0200 (CEST)
From: Julia Lawall <julia.lawall@...ia.fr>
To: Markus Elfring <Markus.Elfring@....de>
cc: Coccinelle <cocci@...teme.lip6.fr>,
Dejin Zheng <zhengdejin5@...il.com>,
Denis Efremov <efremov@...ux.com>,
Gilles Muller <Gilles.Muller@...6.fr>,
Masahiro Yamada <masahiroy@...nel.org>,
Michal Marek <michal.lkml@...kovi.net>,
Nicolas Palix <nicolas.palix@...g.fr>,
kernel-janitors@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Coccinelle: api: Add SmPL script “use_devm_platform_get_and_ioremap_resource.cocci”
> >>>> +@...lacement depends on patch@
> >>>> +expression base, device1, device2, index, private, resource;
> >>>> +@@
> >>>> +(
> >>>> +-resource = platform_get_resource(device1, IORESOURCE_MEM, index);
> >>>> + base =
> >>>> +- devm_ioremap_resource
> >>>> ++ devm_platform_get_and_ioremap_resource
> >>>> + (
> >>>> +- &
> >>>> + device1
> >>>> +- ->dev
> >>>> + ,
> >>>> +- resource
> >>>> ++ index, &resource
> >>>> + );
> >>>> +|
> >>>> +-private->res = platform_get_resource(device1, IORESOURCE_MEM, index);
> >>>> + base =
> >>>> +- devm_ioremap_resource
> >>>> ++ devm_platform_get_and_ioremap_resource
> >>>> + (device2,
> >>>
> >>> It is very suspicious that in one case you change the first argument of
> >>> devm_platform_get_and_ioremap_resource and in one case you don't.
> >>
> >> I noticed a few special cases during my source code analysis approach.
> >
> > This is not a reasonable answer. Does the rule work correctly or not?
> > If it doesn't work correctly, it needs to be removed.
>
> Both source code change patterns from these branches of a SmPL disjunction
> work as I would expect it by the current Coccinelle software.
> Would you like to clarify any remaining related open issues?
In one case the first argument of devm_ioremap_resource has to be changed
to produce the first argument of devm_platform_get_and_ioremap_resource
and in the other case there is no such change. "work as I would expect"
is not a proper explanation of why this is correct. Maybe you can point
to some previous commits that have made the change in this way.
julia
Powered by blists - more mailing lists