[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161220141936.GX1074@mtr-leonro.local>
Date: Tue, 20 Dec 2016 16:19:36 +0200
From: Leon Romanovsky <leonro@...lanox.com>
To: Geliang Tang <geliangtang@...il.com>
CC: Saeed Mahameed <saeedm@...lanox.com>,
Matan Barak <matanb@...lanox.com>, <netdev@...r.kernel.org>,
<linux-rdma@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] net/mlx5: use rb_entry()
On Tue, Dec 20, 2016 at 10:02:14PM +0800, Geliang Tang wrote:
> To make the code clearer, use rb_entry() instead of container_of() to
> deal with rbtree.
>
> Signed-off-by: Geliang Tang <geliangtang@...il.com>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks,
Acked-by: Leon Romanovsky <leonro@...lanox.com>
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c
> index 3b026c1..7431f63 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c
> @@ -75,7 +75,7 @@ static void mlx5_fc_stats_insert(struct rb_root *root, struct mlx5_fc *counter)
> struct rb_node *parent = NULL;
>
> 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;
>
> parent = *new;
> --
> 2.9.3
>
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists