All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 6lowpan: use rb_entry()
@ 2017-01-20 14:36 Geliang Tang
  2017-01-20 14:36 ` [PATCH] dm bio prison: " Geliang Tang
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Geliang Tang @ 2017-01-20 14:36 UTC (permalink / raw)
  To: Alexander Aring, Jukka Rissanen, David S. Miller
  Cc: Geliang Tang, linux-bluetooth, linux-wpan, netdev, linux-kernel

To make the code clearer, use rb_entry() instead of container_of() to
deal with rbtree.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 net/6lowpan/nhc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/6lowpan/nhc.c b/net/6lowpan/nhc.c
index 7008d53..4fa2fdd 100644
--- a/net/6lowpan/nhc.c
+++ b/net/6lowpan/nhc.c
@@ -27,8 +27,8 @@ 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,
-						       node);
+		struct lowpan_nhc *this = rb_entry(*new, struct lowpan_nhc,
+						   node);
 		int result, len_dif, len;
 
 		len_dif = nhc->idlen - this->idlen;
@@ -69,8 +69,8 @@ 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,
-						      node);
+		struct lowpan_nhc *nhc = rb_entry(node, struct lowpan_nhc,
+						  node);
 		u8 nhcid_skb_ptr_masked[LOWPAN_NHC_MAX_ID_LEN];
 		int result, i;
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2017-05-06 15:39 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-20 14:36 [PATCH] 6lowpan: use rb_entry() Geliang Tang
2017-01-20 14:36 ` [PATCH] dm bio prison: " Geliang Tang
2017-01-20 15:12   ` Coly Li
2017-05-06 15:39     ` [PATCH v2] " Geliang Tang
2017-01-20 14:36 ` [PATCH] drm/i915/error: " Geliang Tang
2017-01-20 14:36   ` Geliang Tang
2017-01-23  9:10   ` [Intel-gfx] " Chris Wilson
2017-01-23  9:10     ` Chris Wilson
2017-01-20 14:36 ` [PATCH] drm/nouveau/client: " Geliang Tang
2017-01-20 14:36   ` Geliang Tang
     [not found]   ` <22da087ad757fafdb206fd0c57d286449302acdb.1484816560.git.geliangtang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-01-21  0:14     ` Ben Skeggs
2017-01-20 14:36 ` [PATCH] net/mlx4: " Geliang Tang
2017-01-22  7:48   ` Leon Romanovsky
2017-01-22 14:42     ` Geliang Tang
2017-01-22 19:05       ` Leon Romanovsky
2017-01-22 21:48     ` David Miller
2017-01-22 21:48   ` David Miller
2017-01-20 15:24 ` ✗ Fi.CI.BAT: failure for drm/i915/error: " Patchwork
2017-01-22 21:47 ` [PATCH] 6lowpan: " David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.