From: Daniel Vacek <neelx@redhat.com>
To: Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>
Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
Daniel Vacek <neelx@redhat.com>
Subject: [PATCH 2/2] IB/ipoib: Clean up redundant netif_addr_lock
Date: Mon, 11 Dec 2023 14:04:25 +0100 [thread overview]
Message-ID: <20231211130426.1500427-3-neelx@redhat.com> (raw)
In-Reply-To: <20231211130426.1500427-1-neelx@redhat.com>
A single memory load does not need to be protected by any lock.
The same priv->flags are fetched 15 lines ago without locking anyways.
Signed-off-by: Daniel Vacek <neelx@redhat.com>
---
drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index 8e4f2c8839be..f54e0d212630 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -572,13 +572,9 @@ void ipoib_mcast_join_task(struct work_struct *work)
return;
}
priv->local_lid = port_attr.lid;
- netif_addr_lock_bh(dev);
- if (!test_bit(IPOIB_FLAG_DEV_ADDR_SET, &priv->flags)) {
- netif_addr_unlock_bh(dev);
+ if (!test_bit(IPOIB_FLAG_DEV_ADDR_SET, &priv->flags))
return;
- }
- netif_addr_unlock_bh(dev);
mutex_lock(&priv->mcast_mutex);
spin_lock_irq(&priv->lock);
--
2.43.0
next prev parent reply other threads:[~2023-12-11 13:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-11 13:04 [PATCH 0/2] IB/ipoib fixes Daniel Vacek
2023-12-11 13:04 ` [PATCH 1/2] IB/ipoib: Fix mcast list locking Daniel Vacek
2023-12-11 13:45 ` Leon Romanovsky
2023-12-11 14:25 ` Daniel Vacek
2023-12-11 15:06 ` Leon Romanovsky
2023-12-11 16:00 ` Daniel Vacek
2023-12-12 7:00 ` Leon Romanovsky
2023-12-11 13:04 ` Daniel Vacek [this message]
2023-12-12 8:07 ` [PATCH v2] " Daniel Vacek
2023-12-12 8:29 ` [PATCH 0/2] IB/ipoib fixes Leon Romanovsky
2023-12-13 12:18 ` Daniel Vacek
2023-12-17 12:50 ` Leon Romanovsky
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=20231211130426.1500427-3-neelx@redhat.com \
--to=neelx@redhat.com \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
/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