[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231211130426.1500427-3-neelx@redhat.com>
Date: Mon, 11 Dec 2023 14:04:25 +0100
From: Daniel Vacek <neelx@...hat.com>
To: Jason Gunthorpe <jgg@...pe.ca>, Leon Romanovsky <leon@...nel.org>
Cc: linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
Daniel Vacek <neelx@...hat.com>
Subject: [PATCH 2/2] IB/ipoib: Clean up redundant netif_addr_lock
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@...hat.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
Powered by blists - more mailing lists