On Mon, 2023-01-30 at 09:37 +0100, Julia Lawall wrote: > > Sorry, false alarm. I was running spatch by itself on an inner > > directory (.../i915/display), but when I used find, I was using > > .../i915, so there was one more match happening there. > > > > So, it seems that the latest head _does_ work fine! And I'm gettign > > all > > the matches and changes that I expect. Thanks! > > Great news :) Maybe I celebrated a bit too early. There is still one instance that is not matching... I currently have these rules: @macros_noargs@ identifier m; expression e =~ "dev_priv"; @@ #define m <+...e...+> @nested_macros@ identifier macros_noargs.m; identifier nm; identifier list il; @@ #define nm(il) <+...m...+> @@ identifier nested_macros.nm; identifier dev_priv, f; expression list el; @@ f(...) { ... struct drm_i915_private *dev_priv = ...; <+... nm( + dev_priv, el) ...+> } @@ identifier nested_macros.nm; identifier dev_priv, f; expression list el; @@ f(..., struct drm_i915_private *dev_priv, ...) { <+... nm( + dev_priv, el) ...+> } And then we have this function in drivers/gpu/drm/i915/display/intel_display.c: void vlv_wait_port_ready(struct drm_i915_private *dev_priv, struct intel_digital_port *dig_port, unsigned int expected_mask) { [...] switch (dig_port->base.port) { default: MISSING_CASE(dig_port->base.port); fallthrough; case PORT_B: port_mask = DPLL_PORTB_READY_MASK; dpll_reg = DPLL(0); break; case PORT_C: port_mask = DPLL_PORTC_READY_MASK; dpll_reg = DPLL(0); expected_mask <<= 4; break; [...] } The DPLL macro is defined like this (in drivers/gpu/drm/i915/display/i915_reg.h): #define _DPLL_A (DISPLAY_MMIO_BASE(dev_priv) + 0x6014) #define _DPLL_B (DISPLAY_MMIO_BASE(dev_priv) + 0x6018) #define _CHV_DPLL_C (DISPLAY_MMIO_BASE(dev_priv) + 0x6030) #define DPLL(pipe) _MMIO_PIPE3((pipe), _DPLL_A, _DPLL_B, _CHV_DPLL_C) So it should match like the other instances, but it doesn't. I copied the macro definition and the function to stand-alone files (i.e. without the rest of the code) and it matches, but in the real code, running cocci like this, it doesn't: ~/public/coccinelle/spatch.opt --sp-file ~/dev_priv_i915.spatch --all-includes intel_display.c I noticed some parsing errors when using --debug (output attached), so maybe there's some parsing issues with the real file that prevents the rule from applying? Any clues? -- Cheers, Luca.