diff options
author | Geliang Tang <geliangtang@gmail.com> | 2017-01-20 09:36:53 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-01-22 16:46:13 -0500 |
commit | 530cef21d98930c4d10f188325e00330455d216d (patch) | |
tree | 2592fa3f82ba2db1113490113a04ebf712392f3a /net/6lowpan | |
parent | 9a549c1e35b0a363c3b46b9a08009252c5bc32c3 (diff) |
6lowpan: use rb_entry()
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>
Diffstat (limited to 'net/6lowpan')
-rw-r--r-- | net/6lowpan/nhc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/6lowpan/nhc.c b/net/6lowpan/nhc.c index 7008d53e455c..4fa2fdda174d 100644 --- a/net/6lowpan/nhc.c +++ b/net/6lowpan/nhc.c | |||
@@ -27,8 +27,8 @@ static int lowpan_nhc_insert(struct lowpan_nhc *nhc) | |||
27 | 27 | ||
28 | /* Figure out where to put new node */ | 28 | /* Figure out where to put new node */ |
29 | while (*new) { | 29 | while (*new) { |
30 | struct lowpan_nhc *this = container_of(*new, struct lowpan_nhc, | 30 | struct lowpan_nhc *this = rb_entry(*new, struct lowpan_nhc, |
31 | node); | 31 | node); |
32 | int result, len_dif, len; | 32 | int result, len_dif, len; |
33 | 33 | ||
34 | len_dif = nhc->idlen - this->idlen; | 34 | len_dif = nhc->idlen - this->idlen; |
@@ -69,8 +69,8 @@ static struct lowpan_nhc *lowpan_nhc_by_nhcid(const struct sk_buff *skb) | |||
69 | const u8 *nhcid_skb_ptr = skb->data; | 69 | const u8 *nhcid_skb_ptr = skb->data; |
70 | 70 | ||
71 | while (node) { | 71 | while (node) { |
72 | struct lowpan_nhc *nhc = container_of(node, struct lowpan_nhc, | 72 | struct lowpan_nhc *nhc = rb_entry(node, struct lowpan_nhc, |
73 | node); | 73 | node); |
74 | u8 nhcid_skb_ptr_masked[LOWPAN_NHC_MAX_ID_LEN]; | 74 | u8 nhcid_skb_ptr_masked[LOWPAN_NHC_MAX_ID_LEN]; |
75 | int result, i; | 75 | int result, i; |
76 | 76 | ||