driver inclusion category: cleanup bugzilla: https://gitee.com/openeuler/kernel/issues/I8LY0D
--------------------------------------------------------------------------
This patch removes an unnecessary NULL check for ndev in hns_roce_get_netdev().
Signed-off-by: Chengchang Tang tangchengchang@huawei.com --- drivers/infiniband/hw/hns/hns_roce_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c index c05ac62a3b76..a1b4f84675bc 100644 --- a/drivers/infiniband/hw/hns/hns_roce_main.c +++ b/drivers/infiniband/hw/hns/hns_roce_main.c @@ -61,8 +61,7 @@ static struct net_device *hns_roce_get_netdev(struct ib_device *ib_dev, if (!ndev) ndev = get_hr_netdev(hr_dev, port_num - 1);
- if (ndev) - dev_hold(ndev); + dev_hold(ndev);
rcu_read_unlock();