summaryrefslogtreecommitdiff
path: root/net/smc
diff options
context:
space:
mode:
authorYajun Deng <yajun.deng@linux.dev>2021-08-05 19:55:27 +0800
committerDavid S. Miller <davem@davemloft.net>2021-08-05 13:27:50 +0100
commit1160dfa178eb848327e9dec39960a735f4dc1685 (patch)
treeb9e62879f43f63602da7a68c20d8e58a5acf79f3 /net/smc
parenta85b99ab6abb583e051d266c2138647daa5c0ecc (diff)
net: Remove redundant if statements
The 'if (dev)' statement already move into dev_{put , hold}, so remove redundant if statements. Signed-off-by: Yajun Deng <yajun.deng@linux.dev> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc')
-rw-r--r--net/smc/smc_ib.c3
-rw-r--r--net/smc/smc_pnet.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/net/smc/smc_ib.c b/net/smc/smc_ib.c
index 7d7ba0320d5a..a8845343d183 100644
--- a/net/smc/smc_ib.c
+++ b/net/smc/smc_ib.c
@@ -753,8 +753,7 @@ void smc_ib_ndev_change(struct net_device *ndev, unsigned long event)
if (!libdev->ops.get_netdev)
continue;
lndev = libdev->ops.get_netdev(libdev, i + 1);
- if (lndev)
- dev_put(lndev);
+ dev_put(lndev);
if (lndev != ndev)
continue;
if (event == NETDEV_REGISTER)
diff --git a/net/smc/smc_pnet.c b/net/smc/smc_pnet.c
index 6f6d33edb135..4a964e9190b0 100644
--- a/net/smc/smc_pnet.c
+++ b/net/smc/smc_pnet.c
@@ -394,8 +394,7 @@ static int smc_pnet_add_eth(struct smc_pnettable *pnettable, struct net *net,
return 0;
out_put:
- if (ndev)
- dev_put(ndev);
+ dev_put(ndev);
return rc;
}