Commit 2f60b288 authored by Geliang Tang's avatar Geliang Tang Committed by Juergen Gross

xen/evtchn: use rb_entry()

To make the code clearer, use rb_entry() instead of container_of() to
deal with rbtree.
Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
parent 7ecec850
...@@ -125,7 +125,7 @@ static int add_evtchn(struct per_user_data *u, struct user_evtchn *evtchn) ...@@ -125,7 +125,7 @@ static int add_evtchn(struct per_user_data *u, struct user_evtchn *evtchn)
while (*new) { while (*new) {
struct user_evtchn *this; struct user_evtchn *this;
this = container_of(*new, struct user_evtchn, node); this = rb_entry(*new, struct user_evtchn, node);
parent = *new; parent = *new;
if (this->port < evtchn->port) if (this->port < evtchn->port)
...@@ -157,7 +157,7 @@ static struct user_evtchn *find_evtchn(struct per_user_data *u, unsigned port) ...@@ -157,7 +157,7 @@ static struct user_evtchn *find_evtchn(struct per_user_data *u, unsigned port)
while (node) { while (node) {
struct user_evtchn *evtchn; struct user_evtchn *evtchn;
evtchn = container_of(node, struct user_evtchn, node); evtchn = rb_entry(node, struct user_evtchn, node);
if (evtchn->port < port) if (evtchn->port < port)
node = node->rb_left; node = node->rb_left;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment