linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* cocci script hints request
@ 2021-04-13  9:04 Fabio Aiuto
  2021-04-13  9:11 ` Greg KH
  2021-04-13  9:56 ` Julia Lawall
  0 siblings, 2 replies; 6+ messages in thread
From: Fabio Aiuto @ 2021-04-13  9:04 UTC (permalink / raw)
  To: gregkh, joe, julia.lawall; +Cc: linux-staging, linux-kernel

Hi,

I would like to improve the following coccinelle script:

@@
expression a, fmt;
expression list var_args;
@@

-       DBG_871X_LEVEL(a, fmt, var_args);
+       printk(fmt, var_args);

I would  replace the DBG_871X_LEVEL macro with printk, but
I can't find a way to add KERN_* constant prefix to the fmt
argument in the + code line. If i try this

@@
expression a, fmt;
expression list var_args;
@@

-       DBG_871X_LEVEL(a, fmt, var_args);
+       printk(KERN_DEBUG fmt, var_args);

plus: parse error: 
  File "../test.cocci", line 94, column 20, charpos = 1171
  around = 'fmt',
  whole content = +	printk(KERN_DEBUG fmt, var_args);

how could I do this?

thank you in advance,

fabio

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

end of thread, other threads:[~2021-04-13 10:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-13  9:04 cocci script hints request Fabio Aiuto
2021-04-13  9:11 ` Greg KH
2021-04-13  9:24   ` Fabio Aiuto
2021-04-13  9:42     ` Greg KH
2021-04-13  9:56 ` Julia Lawall
2021-04-13 10:07   ` Fabio Aiuto

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).