Hi guys, I write the following file to change some variable's definition:

@adpt_name@
type adpt_type;
identifier  adpt_var;
@@
adpt_type *adpt_var = ...;
...
- pci_set_drvdata(..., adpt_var);

@@
type adpt_name.adpt_type;
expression e1, e2, e3;
@@
static driver_t alx_driver = {
       e1, e2,
- e3,
+ sizeof(adpt_type),
};
//"+ adpt_type aaa;"

I have to uncomment the latest statement  to make changes to "alx_driver".
But I don't want the redundant  variable "aaa";

Is there any res restrictions  on "sizeof()" ?
How can I change my rule to change "alx_driver" definition without adding "adpt_type aaa"?

Thanks

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

Reply via email to