[Intel-gfx] [PATCH 2/5] drm/i915: Introduce a for_each_crtc() macro

Daniel Vetter daniel at ffwll.ch
Tue May 13 21:51:27 CEST 2014


On Tue, May 13, 2014 at 06:45:02PM +0200, Daniel Vetter wrote:
> On Tue, May 13, 2014 at 03:30:25PM +0100, Damien Lespiau wrote:
> > Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
> 
> cocinelle for these two over the entire tree?

Ok, after much swearing I think I've figured out the pattern here.
-Daniel

@@ 
iterator name list_for_each_entry;
iterator name for_each_crtc;
struct drm_crtc * crtc;
struct drm_device * dev;
@@
-list_for_each_entry(crtc,&dev->mode_config.crtc_list, head) {
+for_each_crtc(dev,crtc, head) {
...
}
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch



More information about the Intel-gfx mailing list