Is there a neater way to write this:

@ rule1 @
identifier fn;
@@
arch_reset = fn;
@@
identifier rule1.fn, mode, cmd;
@@
void fn(char mode, const char *cmd)
{
...
- local_irq_disable();
...
}
@@
identifier mode, cmd;
@@
arch_reset(char mode, const char *cmd)
{
...
- local_irq_disable();
...
}

The idea is to remove calls to local_irq_disable() inside any function
to do with the arch_reset().  Some ARM platforms define this as an inline
function, others define arch_reset() as a pointer, and assign some other
function to that pointer.

I'm wondering whether there's a way to express both conditions with
the 'fn' identifier above.

Thanks.

-- 
Russell King
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to