Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754573AbcLTVxl (ORCPT ); Tue, 20 Dec 2016 16:53:41 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:36321 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752340AbcLTVxi (ORCPT ); Tue, 20 Dec 2016 16:53:38 -0500 Message-ID: <1482270801.1521.25.camel@edumazet-glaptop3.roam.corp.google.com> Subject: Re: [PATCH] xen/blkback: use rb_entry() From: Eric Dumazet To: Konrad Rzeszutek Wilk Cc: Roger Pau =?ISO-8859-1?Q?Monn=E9?= , Geliang Tang , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Date: Tue, 20 Dec 2016 13:53:21 -0800 In-Reply-To: <20161220175113.GB16671@char.us.oracle.com> References: <20161220164703.GL10069@char.us.oracle.com> <20161220174406.uewt5mhniwtznran@dhcp-3-221.uk.xensource.com> <20161220175113.GB16671@char.us.oracle.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1112 Lines: 34 On Tue, 2016-12-20 at 12:51 -0500, Konrad Rzeszutek Wilk wrote: > On Tue, Dec 20, 2016 at 05:44:06PM +0000, Roger Pau Monné wrote: > > On Tue, Dec 20, 2016 at 11:47:03AM -0500, Konrad Rzeszutek Wilk wrote: > > > On Tue, Dec 20, 2016 at 10:02:19PM +0800, Geliang Tang wrote: > > > > To make the code clearer, use rb_entry() instead of container_of() to > > > > deal with rbtree. > > > > > > That is OK but I think 'container_of' is more clear. > > > > > > Roger, thoughts? > > > > I think so, container_of is a global macro that's widely used and everyone > > knows, rb_entry OTOH it's not and it's use doesn't really simply the code at > > all. I'm not really opposed, but it seems kind of a pointless change (not that > > it's wrong). > > I concur. > > Geliang Tang, > > Thank you for the patch but there is no need for it. The same could be said of list_entry() #define hlist_entry(ptr, type, member) container_of(ptr,type,member) #define list_entry(ptr, type, member) container_of(ptr, type, member) # git grep -n list_entry | wc -l 3636 rb_entry() will probably make its way everywhere.