From: Leon Romanovsky <leon@leon.nu>
To: Geliang Tang <geliangtang@163.com>
Cc: Doug Ledford <dledford@redhat.com>,
Sean Hefty <sean.hefty@intel.com>,
Hal Rosenstock <hal.rosenstock@gmail.com>,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] IB/mlx4: use list_for_each_entry_safe in search_relocate_mgid0_group
Date: Mon, 7 Dec 2015 22:44:52 +0200 [thread overview]
Message-ID: <20151207204452.GB7313@leon.nu> (raw)
In-Reply-To: <dada9ed857f53514519bbf57828380fdc72c827f.1449500617.git.geliangtang@163.com>
On Mon, Dec 07, 2015 at 11:04:43PM +0800, Geliang Tang wrote:
> Simplify the code with list_for_each_entry_safe().
>
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
> drivers/infiniband/hw/mlx4/mcg.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/infiniband/hw/mlx4/mcg.c b/drivers/infiniband/hw/mlx4/mcg.c
> index 99451d8..ebdca2b 100644
> --- a/drivers/infiniband/hw/mlx4/mcg.c
> +++ b/drivers/infiniband/hw/mlx4/mcg.c
> @@ -747,14 +747,11 @@ static struct mcast_group *search_relocate_mgid0_group(struct mlx4_ib_demux_ctx
> __be64 tid,
> union ib_gid *new_mgid)
> {
> - struct mcast_group *group = NULL, *cur_group;
> + struct mcast_group *group = NULL, *cur_group, *n;
> struct mcast_req *req;
> - struct list_head *pos;
> - struct list_head *n;
>
> mutex_lock(&ctx->mcg_table_lock);
> - list_for_each_safe(pos, n, &ctx->mcg_mgid0_list) {
> - group = list_entry(pos, struct mcast_group, mgid0_list);
> + list_for_each_entry_safe(group, n, &ctx->mcg_mgid0_list, mgid0_list) {
> mutex_lock(&group->lock);
> if (group->last_req_tid == tid) {
> if (memcmp(new_mgid, &mgid0, sizeof mgid0)) {
Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
> --
> 2.5.0
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2015-12-07 20:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-07 15:04 Geliang Tang
2015-12-07 20:44 ` Leon Romanovsky [this message]
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=20151207204452.GB7313@leon.nu \
--to=leon@leon.nu \
--cc=dledford@redhat.com \
--cc=geliangtang@163.com \
--cc=hal.rosenstock@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=sean.hefty@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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
all inboxes | Powered by JetHome®