From: Daniel Vetter Subject: Re: [PATCH 2/5] drm/i915: Introduce a for_each_crtc() macro Date: Tue, 13 May 2014 21:51:27 +0200 Message-ID: <20140513195127.GV3908@phenom.ffwll.local> References: <1399991428-32763-1-git-send-email-damien.lespiau@intel.com> <1399991428-32763-3-git-send-email-damien.lespiau@intel.com> <20140513164502.GN3908@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ee0-f41.google.com (mail-ee0-f41.google.com [74.125.83.41]) by gabe.freedesktop.org (Postfix) with ESMTP id E316F6E7DC for ; Tue, 13 May 2014 12:51:31 -0700 (PDT) Received: by mail-ee0-f41.google.com with SMTP id t10so735573eei.0 for ; Tue, 13 May 2014 12:51:30 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140513164502.GN3908@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Damien Lespiau Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org 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 > > 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