thanks,
it works.
----------------------------------------------------------------------------
From: Julia Lawall
Sent: Wednesday, June 20, 2012 3:33 PM
To: yafo lee
Cc: [email protected]
Subject: Re: [Cocci] How to add a statement as the first statement in the
function
On Wed, 20 Jun 2012, yafo lee wrote:
Hi gus, I want to add a pirntf() to a function as the first statement
just after the variable definition.
Is there any possibility to wirte a generic rule? thanks.
static void __devexit alx_remove(device_t pdev)
{
struct alx_adapter *adpt = device_get_softc(pdev);
struct alx_hw *hw = &adpt->hw;
struct ifnet *netdev = adpt->netdev;
+ printf("hello word\n");
SET_ADPT_FLAG(1, STATE_DOWN);
cancel_work_sync(&adpt->alx_task);
Yes. Declarations don't match statement metavariables. So you can do the
following:
f(...) {
... when != S1
+ printf("hello world\n"),
S2
... when any
}
julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)