cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
* [Cocci] ormatting problems when introducing a function with coccinelle
@ 2019-04-07 18:49 Guenter Roeck
  2019-04-07 19:09 ` Julia Lawall
  2019-04-07 19:18 ` Julia Lawall
  0 siblings, 2 replies; 7+ messages in thread
From: Guenter Roeck @ 2019-04-07 18:49 UTC (permalink / raw)
  To: cocci

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.

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
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-04-07 20:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-07 18:49 [Cocci] ormatting problems when introducing a function with coccinelle Guenter Roeck
2019-04-07 19:09 ` Julia Lawall
2019-04-07 20:03   ` Guenter Roeck
2019-04-07 20:05     ` Julia Lawall
2019-04-07 20:17       ` Guenter Roeck
2019-04-07 19:18 ` Julia Lawall
2019-04-07 20:14   ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).