> 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 way.
// SPDX-License-Identifier: GPL-2.0
static int rcar_i2c_probe(struct platform_device *pdev)
{
struct rcar_i2c_priv *priv;
priv->res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
priv->io = devm_ioremap_resource(&pdev->dev, priv->res);
if (IS_ERR(priv->io))
return PTR_ERR(priv->io);
}
Command example:
elfring@Sonne:~/Projekte/Coccinelle/janitor> spatch
use_devm_platform_get_and_ioremap_resource3.cocci
../Probe/i2c-rcar-variant-20200416.c
Implementation details from the original source file trigger some
software development challenges.
https://elixir.bootlin.com/linux/v5.7-rc1/source/drivers/i2c/busses/i2c-rcar.c#L921
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/i2c/busses/i2c-rcar.c?id=8632e9b5645bbc2331d21d892b0d6961c1a08429#n921
Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci