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

net/mlx5: 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>
Acked-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ae99b639
...@@ -75,7 +75,7 @@ static void mlx5_fc_stats_insert(struct rb_root *root, struct mlx5_fc *counter) ...@@ -75,7 +75,7 @@ static void mlx5_fc_stats_insert(struct rb_root *root, struct mlx5_fc *counter)
struct rb_node *parent = NULL; struct rb_node *parent = NULL;
while (*new) { while (*new) {
struct mlx5_fc *this = container_of(*new, struct mlx5_fc, node); struct mlx5_fc *this = rb_entry(*new, struct mlx5_fc, node);
int result = counter->id - this->id; int result = counter->id - this->id;
parent = *new; parent = *new;
......
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