Commit 530cef21 authored by Geliang Tang's avatar Geliang Tang Committed by David S. Miller

6lowpan: 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>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9a549c1e
......@@ -27,7 +27,7 @@ static int lowpan_nhc_insert(struct lowpan_nhc *nhc)
/* Figure out where to put new node */
while (*new) {
struct lowpan_nhc *this = container_of(*new, struct lowpan_nhc,
struct lowpan_nhc *this = rb_entry(*new, struct lowpan_nhc,
node);
int result, len_dif, len;
......@@ -69,7 +69,7 @@ static struct lowpan_nhc *lowpan_nhc_by_nhcid(const struct sk_buff *skb)
const u8 *nhcid_skb_ptr = skb->data;
while (node) {
struct lowpan_nhc *nhc = container_of(node, struct lowpan_nhc,
struct lowpan_nhc *nhc = rb_entry(node, struct lowpan_nhc,
node);
u8 nhcid_skb_ptr_masked[LOWPAN_NHC_MAX_ID_LEN];
int result, i;
......
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