From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH 05/18] drm: Introduce an iterator over holes in the drm_mm range manager Date: Mon, 05 Nov 2012 15:13:10 +0000 Message-ID: <84c8a8$6dc1qr@orsmga001.jf.intel.com> References: <1350666204-8101-1-git-send-email-chris@chris-wilson.co.uk> <1350666204-8101-5-git-send-email-chris@chris-wilson.co.uk> <20121105134106.4a5ea71d@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id CE4059F0EF for ; Mon, 5 Nov 2012 07:14:24 -0800 (PST) In-Reply-To: <20121105134106.4a5ea71d@bwidawsk.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Ben Widawsky Cc: Dave Airlie , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Mon, 5 Nov 2012 13:41:06 +0000, Ben Widawsky wrote: > On Fri, 19 Oct 2012 18:03:11 +0100 > Chris Wilson wrote: > > - BUG_ON(drm_mm_hole_node_start(node) > > - != drm_mm_hole_node_end(node)); > > + BUG_ON(node->start + node->size != > > + list_entry(node->node_list.next, > > + struct drm_mm_node, node_list)->start); > > + > > > > This seems harder to read to me than before. I suspect you've changed it > only because you've moved the inline functions down, but I also don't > understand the reason for that. Since I move the BUG_ON() into drm_mm_hole_node_end() and this is the atypical caller, I chose to make this code less clear in order to make the other callsites clearer. The other choice is to use __drm_mm_hole_node_end(), which is probably worthwhile. > > + > > +/* Note that we need to unroll list_for_each_entry in order to inline > > + * setting hole_start and hole_end on each iteration and keep the > > + * macro sane. > > + */ > > This comment is probably better suited for the commit message then here > where it'd require git blame to make any sense of it. No, I think list_for_each_entry() is a common macro that the reader might have expected to see and so we need to explain why we cannot use it here. -Chris -- Chris Wilson, Intel Open Source Technology Centre