You need to give some information about the C file.  With the following C
file, everything is fine for me.

julia

int main () {
  adpt_type *adpt_var = NULL;
  pci_set_drvdata(foo, adpt_var);
}

static driver_t alx_driver = {
       e1, e2, e3
};

------------------


On Thu, 14 Jun 2012, yafo lee wrote:

> 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)
>
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to