On 4/7/19 12:18 PM, Julia Lawall wrote:
On Sun, 7 Apr 2019, Guenter Roeck wrote:Hi Coccinelle experts, I am trying to introduce a new function with coccinelle. The semantic patch is something like @devm depends on prb@ identifier r.initfn; identifier fname.clkfunc; @@ + static void clkfunc(void *data) { clk_disable_unprepare(data); } initfn(...) { ... } This works, but the resulting output is always +static void armada_clk_disable_unprepare(void *data) { + clk_disable_unprepare(data); +} + static int armada_37xx_wdt_probe(struct platform_device *pdev) meaning the opening '{' is in the same line as the function declaration. It doesn't matter if I provide the function in a single line or in multiple lines. It also doesn't matter if I try to manipulate the function afterwards. The output looks always the same.You can try the new version on github.
Super. That works just great. Thanks a lot! Guenter
juliaIs there a way to tell coccinelle that it should generate +static void armada_clk_disable_unprepare(void *data) +{ + clk_disable_unprepare(data); +} + static int armada_37xx_wdt_probe(struct platform_device *pdev) instead ? Thanks, Guenter _______________________________________________ Cocci mailing list [email protected] https://systeme.lip6.fr/mailman/listinfo/cocci
_______________________________________________ Cocci mailing list [email protected] https://systeme.lip6.fr/mailman/listinfo/cocci
