All of lore.kernel.org
 help / color / mirror / Atom feed
* [cocci] Nested macros
@ 2023-01-27 17:07 Luca Coelho
  2023-01-27 18:34 ` [cocci] Checking selected macro calls with SmPL Markus Elfring
  2023-01-27 20:52 ` [cocci] Nested macros Julia Lawall
  0 siblings, 2 replies; 38+ messages in thread
From: Luca Coelho @ 2023-01-27 17:07 UTC (permalink / raw)
  To: cocci; +Cc: julia.lawall

Hi,

I've been struggling with a change I want to make, so I hope someone
can help.

Basically I have something like this in the code:

/* regs below are bits 15:0 */
#define _MIPIA_HSYNC_PADDING_COUNT     (_MIPI_MMIO_BASE(dev_priv) + 0xb028)
#define _MIPIC_HSYNC_PADDING_COUNT     (_MIPI_MMIO_BASE(dev_priv) + 0xb828)
#define MIPI_HSYNC_PADDING_COUNT(port) _MMIO_MIPI(port, _MIPIA_HSYNC_PADDING_COUNT, _MIPIC_HSYNC_PADDING_COUNT)

As you can see, these macros assume that the calling functions have a
local called dev_priv, and I want to fix that. 

So, I'm trying to find all users of macros that have this construct. 
My problem is matching the nesting in the macros.

I have tried this:

@macros_noargs@
identifier m;
expression e =~ "dev_priv";
@@
#define m <+...e...+>

@nested_macros@
identifier macros_noargs.m;
identifier nm;
@@
#define nm(...) <+...m...+>

@@
identifier nested_macros.nm;
@@
-nm
+foo

(this last rule is just for testing if anything is matching, obviously)

But the "nested_macros" rule doesn't seem to work.  Does anyone know
how I can solve this?

Thanks!

--
Cheers,
Luca.


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

end of thread, other threads:[~2023-01-31 16:20 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-27 17:07 [cocci] Nested macros Luca Coelho
2023-01-27 18:34 ` [cocci] Checking selected macro calls with SmPL Markus Elfring
2023-01-27 20:52 ` [cocci] Nested macros Julia Lawall
2023-01-27 22:00   ` Luca Coelho
2023-01-28  9:19     ` Julia Lawall
2023-01-28  9:25       ` Luca Coelho
2023-01-28  9:46     ` [cocci] Searching for special function implementations with SmPL Markus Elfring
2023-01-28  9:49       ` Julia Lawall
2023-01-28 10:03         ` Luca Coelho
2023-01-28 13:33           ` Julia Lawall
2023-01-29 16:39             ` Luca Coelho
2023-01-29 17:28               ` Julia Lawall
2023-01-29 17:55                 ` Luca Coelho
2023-01-29 19:15                   ` Luca Coelho
2023-01-29 20:09                     ` Julia Lawall
2023-01-30  6:32                       ` Luca Coelho
2023-01-30  8:37                         ` Julia Lawall
2023-01-30  8:50                           ` Luca Coelho
2023-01-30  8:56                             ` Julia Lawall
2023-01-30  9:05                               ` Luca Coelho
2023-01-30  9:34                             ` Markus Elfring
2023-01-30  9:41                               ` Luca Coelho
2023-01-30  9:50                                 ` Markus Elfring
2023-01-30  9:52                                   ` Luca Coelho
2023-01-30  9:55                                     ` Julia Lawall
2023-01-30 10:07                                     ` Markus Elfring
2023-01-30 10:47                                     ` Julia Lawall
2023-01-30 10:59                                       ` Luca Coelho
2023-01-30 11:25                                         ` Markus Elfring
2023-01-31 15:57                                         ` Luca Coelho
2023-01-31 15:59                                           ` Luca Coelho
2023-01-31 16:08                                           ` Julia Lawall
2023-01-31 16:10                                             ` Luca Coelho
2023-01-31 16:20                                               ` Julia Lawall
2023-01-29 18:01               ` [cocci] Adding a parameter for special macro calls " Markus Elfring
2023-01-29 19:11                 ` Luca Coelho
2023-01-28 13:43           ` [cocci] Searching for special function implementations " Markus Elfring
2023-01-29 16:41             ` Luca Coelho

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.