On Fri, 15 Jun 2012, Michael Stefaniuc wrote:
> Hello!
>
> On 06/15/2012 10:08 AM, yafo lee wrote:
> > Hi guys, I wanna covert linux's printk:
> > printk(KERN_DEBUG "MAC address is multicast\n");
> > to freebsd's print:
> > printf("MAC address is multicast\n");
> >
> > By using:
> > @@
> > @@
> > - printk
> > + print
> >
> > I can get:
> > printf(KERN_DEBUG "MAC address is multicast\n");
> >
> > But I don't want the macro "KERN_DEBUG", how can I remove it?
> sed. Or perl. On the generated diff. That's what I would do as it is the
> simplest solution.
That is probably the best suggestion. It could be done with Coccinelle,
but it would be awkward. You would have to pass the first argument of
printk through a python script to be able to remove the KERN_DEBUG part.
I can explain how to do that if the sed/perl script is not satisfactory.
julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)