Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH rdma-next] RDMA/mana_ib: Remove redundant NULL check before netdev_put()
@ 2026-08-31  5:21 Sang-Heon Jeon
  2026-09-01 10:33 ` Leon Romanovsky
  0 siblings, 1 reply; 2+ messages in thread
From: Sang-Heon Jeon @ 2026-08-31  5:21 UTC (permalink / raw)
  To: Long Li, Konstantin Taranov, Jason Gunthorpe, Leon Romanovsky
  Cc: linux-hyperv, linux-kernel, linux-rdma

netdev_put() does nothing if dev is NULL, so the check before the call
is redundant.

So remove it. No functional change.

This is the result of running the Coccinelle script from
scripts/coccinelle/free/ifnulldev_put.cocci after commit f83b8a58695c
("coccinelle: ifnulldev_put: update outdated helper names").

Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
 drivers/infiniband/hw/mana/device.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/mana/device.c b/drivers/infiniband/hw/mana/device.c
index a8d19586a78a..62c7803ca6c6 100644
--- a/drivers/infiniband/hw/mana/device.c
+++ b/drivers/infiniband/hw/mana/device.c
@@ -103,8 +103,7 @@ static int mana_ib_netdev_event(struct notifier_block *this,
 				ib_device_set_netdev(&dev->ib_dev, ndev, i + 1);
 
 				/* mana_get_primary_netdev() returns ndev with refcount held */
-				if (ndev)
-					netdev_put(ndev, &dev->dev_tracker);
+				netdev_put(ndev, &dev->dev_tracker);
 
 				return NOTIFY_OK;
 			default:
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH rdma-next] RDMA/mana_ib: Remove redundant NULL check before netdev_put()
  2026-08-31  5:21 [PATCH rdma-next] RDMA/mana_ib: Remove redundant NULL check before netdev_put() Sang-Heon Jeon
@ 2026-09-01 10:33 ` Leon Romanovsky
  0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2026-09-01 10:33 UTC (permalink / raw)
  To: Long Li, Konstantin Taranov, Jason Gunthorpe, Sang-Heon Jeon
  Cc: linux-hyperv, linux-kernel, linux-rdma


On Mon, 31 Aug 2026 14:21:07 +0900, Sang-Heon Jeon wrote:
> netdev_put() does nothing if dev is NULL, so the check before the call
> is redundant.
> 
> So remove it. No functional change.
> 
> This is the result of running the Coccinelle script from
> scripts/coccinelle/free/ifnulldev_put.cocci after commit f83b8a58695c
> ("coccinelle: ifnulldev_put: update outdated helper names").
> 
> [...]

Applied, thanks!

[1/1] RDMA/mana_ib: Remove redundant NULL check before netdev_put()
      https://git.kernel.org/rdma/rdma/c/2f02eee8d632f7

Best regards,
-- 
Leon Romanovsky <leon@kernel.org>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-01 10:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31  5:21 [PATCH rdma-next] RDMA/mana_ib: Remove redundant NULL check before netdev_put() Sang-Heon Jeon
2026-09-01 10:33 ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox