elfring@Sonne:~/Projekte/Linux/next-patched> spatch
--include-headers-for-types
~/Projekte/Coccinelle/janitor/use_devm_platform_get_and_ioremap_resource3.cocci
drivers/i2c/busses/i2c-rcar.c
>>>
>>> No, include headers for types doesn't have any impact on how many header
>>>
> Another possibility should be taken into account for source code variations.
>
> SmPL script example:
> @replacement@
> expression base, device1, device2, index, private;
> @@
> -private->res = platform_get_resource(device1, IORESOURCE_MEM, index);
> base =
> - devm_ioremap_resource
> +
>> But I have now lost track of what the semantic patch actually is,
>> so I don't know what is the problem.
Another possibility should be taken into account for source code variations.
SmPL script example:
@replacement@
expression base, device1, device2, index, private;
@@
-private->res =
> But I have now lost track of what the semantic patch actually is,
> so I don't know what is the problem.
Do you find the following transformation approach easier to clarify?
SmPL script:
@replacement@
expression base, device, index, private;
@@
-private->res = platform_get_resource(device,
> OK, it seems that the structure is defined in the same file so no include
> options should be needed. But I have now lost track of what the
> semantic patch actually is, so I don't know what is the problem.
1. Unfortunately, I needed a bit longer to become more aware of relevant
differences
>> Would I need any extra parameters here?
>
> Perhaps -I options to help it find the relevant .h file.
The dependencies for the data structure “device” can become also more
interesting.
https://elixir.bootlin.com/linux/v5.7-rc1/source/include/linux/device.h#L451
On Thu, 16 Apr 2020, Markus Elfring wrote:
> >> Would I need any extra parameters here?
> >
> > Perhaps -I options to help it find the relevant .h file.
>
> I wonder why the relevant header files would not be found directly
> from the corresponding Git repository.
OK, it seems that the
>> Would I need any extra parameters here?
>
> Perhaps -I options to help it find the relevant .h file.
I wonder why the relevant header files would not be found directly
from the corresponding Git repository.
Can a file inclusion failure become an immediate SmPL script execution error
when a
On Thu, 16 Apr 2020, Markus Elfring wrote:
> >> elfring@Sonne:~/Projekte/Linux/next-patched> spatch
> >> --include-headers-for-types
> >> ~/Projekte/Coccinelle/janitor/use_devm_platform_get_and_ioremap_resource3.cocci
> >> drivers/i2c/busses/i2c-rcar.c
> >
> > No, include headers for types
> I don't think that there is any need for the * in the metavariable
> declaration.
I can try another SmPL script variant out also without the specification
of an extra asterisk. If I test with the following source file example,
a patch is generated by the Coccinelle software in the expected
>> elfring@Sonne:~/Projekte/Linux/next-patched> spatch
>> --include-headers-for-types
>> ~/Projekte/Coccinelle/janitor/use_devm_platform_get_and_ioremap_resource3.cocci
>> drivers/i2c/busses/i2c-rcar.c
>
> No, include headers for types doesn't have any impact on how many header
> files are
On Thu, 16 Apr 2020, Markus Elfring wrote:
> >> @replacement@
> >> expression* base, device, resource;
> >> @@
> >> -resource = platform_get_resource(device, IORESOURCE_MEM, 0);
> >> base =
> >> - devm_ioremap_resource(>dev, resource)
> >> +
>> @replacement@
>> expression* base, device, resource;
>> @@
>> -resource = platform_get_resource(device, IORESOURCE_MEM, 0);
>> base =
>> - devm_ioremap_resource(>dev, resource)
>> + devm_platform_get_and_ioremap_resource(device, 0, )
>> ;
…
>> static int rcar_i2c_probe(struct
>> static int rcar_i2c_probe(struct platform_device *pdev)
>> {
>> struct rcar_i2c_priv *priv;
…
>> struct device *dev = >dev;
>> // deleted part
>> priv->res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>>
>> priv->io = devm_ioremap_resource(dev, priv->res);
…
>> }
…
>
On Wed, 15 Apr 2020, Markus Elfring wrote:
> Hello,
>
> I noticed the suggestion “i2c: busses: convert to
> devm_platform_get_and_ioremap_resource”.
> https://lore.kernel.org/linux-i2c/20200414134827.18674-1-zhengdej...@gmail.com/
> https://lore.kernel.org/patchwork/patch/1223734/
>
> I got
Hello,
I noticed the suggestion “i2c: busses: convert to
devm_platform_get_and_ioremap_resource”.
https://lore.kernel.org/linux-i2c/20200414134827.18674-1-zhengdej...@gmail.com/
https://lore.kernel.org/patchwork/patch/1223734/
I got into the mood to try another script out for the semantic patch
16 matches
Mail list logo