Try -all_includes, or if needed -recursive_includes

Most include files are ignored by default, because processing them takes a lot of time, and there are a lot of things for which they are irrelevant.

When you work on an entire directory, you can also use -include_headers instead of the above options. That causes the .h files to be processed independently of where they are used, which again is also what you often want.

julia

On Tue, 28 Feb 2012, ron minnich wrote:

I'm not understanding something.

[rminnich@myhost video]$ grep setup ib.c intel_bios.h i915_drv.h drmP.h
ib.c:void intel_setup_bios(struct drm_device *dev)
intel_bios.h:void intel_setup_bios(struct drm_device *dev);
i915_drv.h:extern int intel_setup_gmbus(struct drm_device *dev);
i915_drv.h:extern int intel_opregion_setup(struct drm_device *dev);
drmP.h:extern int drm_dma_setup(struct drm_device *dev);

[rminnich@myhost video]$ cat deldev.cocci
@@
identifier func;
identifier d;
@@
-func(struct drm_device *d)
+func(void)
{...}
@@
identifier dev;
expression i;
@@
-struct drm_i915_private *dev = i;

[rminnich@myhost video]$ spatch --in-place -sp_file deldev.cocci ib.c
intel_bios.h i915_drv.h drmP.h > /dev/null
init_defs_builtins: /usr/local/share/coccinelle/standard.h

[rminnich@myhost video]$ !grep
grep setup ib.c intel_bios.h i915_drv.h drmP.h
ib.c:void intel_setup_bios(void)
intel_bios.h:void intel_setup_bios(void);
i915_drv.h:extern int intel_setup_gmbus(struct drm_device *dev);
i915_drv.h:extern int intel_opregion_setup(struct drm_device *dev);
drmP.h:extern int drm_dma_setup(struct drm_device *dev);
[rminnich@myhost video]$

It changed in two of the files, and not in two of the others. Is this
because of the 'change only once' rule?

ron

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

Reply via email to