I'm trying to change a function of this form:
type T;
identifier func;
identifier dev;
expression E;

T funcname(struct drm_dev *dev, E){...}

into
funcname(struct pci_dev *dev, E)

I'd like to change it and all its uses. I'm failing badly. I can
change the uses:
@ ruled @
identifier t;
identifier f;
expression E1, E2;
type T;
@@
T f(...){<...
t = intel_bios_ssc_frequency(E1, E2);
...>}
@@
identifier ruled.f;
expression E1, E2;
@@

intel_bios_ssc_frequency(
-E1,
+video,
E2
   )

But I'm not really doing what I want; I don't want to hardcode the
name, I want ANY function which uses
struct drm_dev * as its first parameter to change.

Similarly, I want to change the declarations.

I tried this for the declarations:

@ ruledd @
identifier f, dev, E2;
type T;
@@
T f(struct drm_dev *dev, E2){...}
@@
identifier ruledd.f;
identifier dev, E2;
@@
f(
-struct drm_dev *dev
+struct pci_dev *dev
, E2){...}


but it's very angry with me:
Fatal error: exception Failure("minus: parse error:
 = File "fixcalls.cocci", line 78, column 25,  charpos = 830
    around = 'E2', whole content = T f(struct drm_dev *dev, E2){...}
")

Any hints welcome ...

thanks. I'm close :-)

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

Reply via email to