lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0c829b89-7ff4-6da8-693e-05e3c5edf5a2@suse.com>
Date:   Tue, 20 Dec 2016 17:20:18 +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>

Reviewed-by: Juergen Gross <jgross@...e.com>

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ