Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3704eb6f authored by Geliang Tang's avatar Geliang Tang Committed by David S. Miller
Browse files

net/mlx4: 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 avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 530cef21
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -236,7 +236,7 @@ static void *res_tracker_lookup(struct rb_root *root, u64 res_id)
	struct rb_node *node = root->rb_node;

	while (node) {
		struct res_common *res = container_of(node, struct res_common,
		struct res_common *res = rb_entry(node, struct res_common,
						  node);

		if (res_id < res->res_id)
@@ -255,7 +255,7 @@ static int res_tracker_insert(struct rb_root *root, struct res_common *res)

	/* Figure out where to put new node */
	while (*new) {
		struct res_common *this = container_of(*new, struct res_common,
		struct res_common *this = rb_entry(*new, struct res_common,
						   node);

		parent = *new;