Semantic patching with Coccinelle
Posted Jan 22, 2009 13:26 UTC (Thu) by
johill (subscriber, #25196)
Parent article:
Semantic patching with Coccinelle
Thanks for the article, I anticipate the .4 release and this is the first I heard of it :)
One thing I've been battling with recently that unfortunately it doesn't support is modifying printf-style formats. I'd love to write something like
@@
string A, B;
expression M, MBUF;
@@
-printk(... "%s" ..., ..., print_mac(MBUF, M), ...);
+printk(... "%pM" ..., ..., M, ...);
but obviously parameter matching is quite a hard task and definitely needs different syntax than what I just invented on the spot.
But even without that, I've used it a few times already, if only to detect problems, e.g. http://thread.gmane.org/gmane.linux.kernel.wireless.general/26371 (though that case required filtering manually for the correct places)
(
Log in to post comments)