RDMA/mana_ib: Remove redundant NULL check before netdev_put()
PATCH 1/1 RDMA/mana_ib: Remove redundant NULL check before netdev_put()
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").
--- drivers/infiniband/hw/mana/device.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/infiniband/hw/mana/device.c +1 -2
@@ -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 :
Signature · 1 line
2.43.0
Leon Romanovsky
AppliedQuoted 10 lines · Sang-Heon Jeon
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.cocciafter commitf83b8a58695c("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,
Signature · 1 line
Leon Romanovsky <[email protected]>