From: Leon Romanovsky <leonro@mellanox•com>
To: Geliang Tang <geliangtang@gmail•com>
Cc: Saeed Mahameed <saeedm@mellanox•com>,
Matan Barak <matanb@mellanox•com>, <netdev@vger•kernel.org>,
<linux-rdma@vger•kernel.org>, <linux-kernel@vger•kernel.org>
Subject: Re: [PATCH] net/mlx5: use rb_entry()
Date: Tue, 20 Dec 2016 16:19:36 +0200 [thread overview]
Message-ID: <20161220141936.GX1074@mtr-leonro.local> (raw)
In-Reply-To: <8443fa3fa03d82c2b829375d8020762e5236dc6d.1482203930.git.geliangtang@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1041 bytes --]
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@gmail•com>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks,
Acked-by: Leon Romanovsky <leonro@mellanox•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
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2016-12-20 14:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <ddabc96c798df194791134d8e070d728e2a7b59f.1482203698.git.geliangtang@gmail.com>
2016-12-20 14:02 ` [PATCH] netfilter: xt_connlimit: use rb_entry() Geliang Tang
2017-01-05 12:26 ` Pablo Neira Ayuso
2016-12-20 14:02 ` [PATCH] net/mlx5: " Geliang Tang
2016-12-20 14:19 ` Leon Romanovsky [this message]
2016-12-20 19:23 ` David Miller
2016-12-20 14:02 ` [PATCH] net_sched: sch_fq: " Geliang Tang
2016-12-20 16:38 ` Eric Dumazet
2016-12-20 19:23 ` David Miller
2016-12-20 14:02 ` [PATCH] net_sched: sch_netem: " Geliang Tang
2016-12-20 19:23 ` David Miller
2016-12-20 14:02 ` [PATCH] RDS: " Geliang Tang
2016-12-20 14:20 ` Leon Romanovsky
[not found] ` <2cd84448fe04ffb7023be892c5ed04bbfc759c87.1482204342.git.geliangtang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-12-20 16:34 ` Santosh Shilimkar
2016-12-20 19:23 ` David Miller
2016-12-22 3:33 ` Doug Ledford
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161220141936.GX1074@mtr-leonro.local \
--to=leonro@mellanox$(echo .)com \
--cc=geliangtang@gmail$(echo .)com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-rdma@vger$(echo .)kernel.org \
--cc=matanb@mellanox$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=saeedm@mellanox$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox