public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <levinsasha928@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: penberg@kernel.org, asias.hejun@gmail.com,
	prasadjoshi124@gmail.com, gorcunov@gmail.com,
	kvm@vger.kernel.org, john@jfloren.net
Subject: Re: [PATCH 1/2] kvm tools: Add interval red-black tree helper
Date: Tue, 17 May 2011 10:55:29 +0300	[thread overview]
Message-ID: <1305618929.12150.23.camel@sasha> (raw)
In-Reply-To: <20110517074115.GG22305@elte.hu>

On Tue, 2011-05-17 at 09:41 +0200, Ingo Molnar wrote:
> * Sasha Levin <levinsasha928@gmail.com> wrote:
> > +#include <kvm/interval-rbtree.h>
> > +#include <stdio.h>
> > +#include <stdlib.h>
> 
> At first sight i dont think you really need the stdio.h and stlib.h includes - 
> you added these while having debugging printfs in the code?

We can drop either of them, but not both. Added it for size_t
definition.

> > +int rb_int_insert(struct rb_root *root, struct rb_int_node *data)
> 
> i'd suggest to rename 'data' to i_node in other places as well. Here we'd want 
> to use the name i_node_root i suspect.
> 
> (Note, naming it 'inode' would suck for us kernel developers :-)
> 
> > +	struct rb_node **new = &(root->rb_node), *parent = NULL;
> > +
> > +	while (*new) {
> > +		struct rb_int_node *this	= RB_INT(*new);
> 
> So the rb-node iterator is named 'new', while the rb-int-node iterator is 
> called 'this'? That does not make sense.

I actually took that bit from an example in Documentation/rbtree.txt of
how to write an insertion function :)

Maybe it's worth doing another rbtree.txt patch and cleaning up the
samples there?


-- 

Sasha.


  reply	other threads:[~2011-05-17  7:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-17  6:58 [PATCH 1/2] kvm tools: Add interval red-black tree helper Sasha Levin
2011-05-17  6:58 ` [PATCH 2/2] kvm tools: Add MMIO address mapper Sasha Levin
2011-05-17  7:42   ` Ingo Molnar
2011-05-17  7:41 ` [PATCH 1/2] kvm tools: Add interval red-black tree helper Ingo Molnar
2011-05-17  7:55   ` Sasha Levin [this message]
2011-05-17  8:05     ` Ingo Molnar
2011-05-17  8:18       ` Pekka Enberg
2011-05-17  8:21         ` Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1305618929.12150.23.camel@sasha \
    --to=levinsasha928@gmail.com \
    --cc=asias.hejun@gmail.com \
    --cc=gorcunov@gmail.com \
    --cc=john@jfloren.net \
    --cc=kvm@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=penberg@kernel.org \
    --cc=prasadjoshi124@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox