[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <32763218-c757-47ac-5b53-7dcfb6a7aafa@suse.com>
Date: Thu, 22 Dec 2016 10:07:13 +0100
From: Juergen Gross <jgross@...e.com>
To: Geliang Tang <geliangtang@...il.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>
Cc: xen-devel@...ts.xenproject.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] xen/evtchn: use rb_entry()
On 20/12/16 15:02, Geliang Tang wrote:
> To make the code clearer, use rb_entry() instead of container_of() to
> deal with rbtree.
>
> Signed-off-by: Geliang Tang <geliangtang@...il.com>
Committed to xen/tip.git for-linus-4.10
Juergen
> ---
> drivers/xen/evtchn.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c
> index e8c7f09..6890897 100644
> --- a/drivers/xen/evtchn.c
> +++ b/drivers/xen/evtchn.c
> @@ -125,7 +125,7 @@ static int add_evtchn(struct per_user_data *u, struct user_evtchn *evtchn)
> while (*new) {
> struct user_evtchn *this;
>
> - this = container_of(*new, struct user_evtchn, node);
> + this = rb_entry(*new, struct user_evtchn, node);
>
> parent = *new;
> if (this->port < evtchn->port)
> @@ -157,7 +157,7 @@ static struct user_evtchn *find_evtchn(struct per_user_data *u, unsigned port)
> while (node) {
> struct user_evtchn *evtchn;
>
> - evtchn = container_of(node, struct user_evtchn, node);
> + evtchn = rb_entry(node, struct user_evtchn, node);
>
> if (evtchn->port < port)
> node = node->rb_left;
>
Powered by blists - more mailing lists