net_sched: sch_netem: use rb_entry()
authorGeliang Tang <geliangtang@gmail.com>
Tue, 20 Dec 2016 14:02:16 +0000 (22:02 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Dec 2016 19:22:48 +0000 (14:22 -0500)
To make the code clearer, use rb_entry() instead of container_of() to
deal with rbtree.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_netem.c

index 9f7b380cf0a3836aca117b6d9bde05e0fecea32b..b7e4097bfdab22dc0f43b314aadf3c001cc3b24f 100644 (file)
@@ -152,7 +152,7 @@ struct netem_skb_cb {
 
 static struct sk_buff *netem_rb_to_skb(struct rb_node *rb)
 {
-       return container_of(rb, struct sk_buff, rbnode);
+       return rb_entry(rb, struct sk_buff, rbnode);
 }
 
 static inline struct netem_skb_cb *netem_skb_cb(struct sk_buff *skb)