Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1545494

Re: [PATCH] xen/blkback: use rb_entry()

From Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH] xen/blkback: use rb_entry()
Date 2016-12-20 23:10 +0100
Message-ID <sQALE-384-43@gated-at.bofh.it> (permalink)
References (1 earlier) <sQth7-6Ck-3@gated-at.bofh.it> <sQvLX-80A-13@gated-at.bofh.it> <sQwI1-bE-11@gated-at.bofh.it> <sQwRI-fa-35@gated-at.bofh.it> <sQABY-2Pp-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Dec 20, 2016 at 01:53:21PM -0800, Eric Dumazet wrote:
> 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).
> > 
> > <nods> I concur.
> > 
> > Geliang Tang,
> > 
> > Thank you for the patch but there is no need for it.
> 
> The same could be said of list_entry()
> 

Sure. And I am used to that as well :-)

> #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.

That is good to know.

But for right now this patch is not necessary. Thank you!

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] xen/blkback: use rb_entry() Geliang Tang <geliangtang@gmail.com> - 2016-12-20 15:10 +0100
  Re: [PATCH] xen/blkback: use rb_entry() Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> - 2016-12-20 17:50 +0100
    Re: [PATCH] xen/blkback: use rb_entry() Roger Pau Monné <roger.pau@citrix.com> - 2016-12-20 18:50 +0100
      Re: [PATCH] xen/blkback: use rb_entry() Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> - 2016-12-20 19:00 +0100
        Re: [PATCH] xen/blkback: use rb_entry() Eric Dumazet <eric.dumazet@gmail.com> - 2016-12-20 23:00 +0100
          Re: [PATCH] xen/blkback: use rb_entry() Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> - 2016-12-20 23:10 +0100

csiph-web