net/mlx5: 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>
Acked-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Geliang Tang 2016-12-20 22:02:14 +08:00 committed by David S. Miller
parent ae99b639ce
commit f7fb138389

View file

@ -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;