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(...) { ... }
You can do:
+ static void clkfunc(void *data)
+{ clk_disable_unprepare(data); }
initfn(...) { ... }
and then use the command line argument --smpl-spacing.
But I will check whether it can be easily fixed.
julia
>
> 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.
>
> Is 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