RDMA/hns: Remove unnecessary check for the sgid_attr when modifying QP
authorChengchang Tang <tangchengchang@huawei.com>
Sat, 9 Apr 2022 08:32:50 +0000 (16:32 +0800)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 11 Apr 2022 14:00:33 +0000 (11:00 -0300)
The sgid_attr cannot be null in this scenario. This judgment is redundant.

Fixes: 606bf89e98ef ("RDMA/hns: Refactor for hns_roce_v2_modify_qp function")
Link: https://lore.kernel.org/r/20220409083254.9696-2-liangwenpeng@huawei.com
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/hns/hns_roce_hw_v2.c

index 2b0cef17ad452f21defc9cd70db4a0d07567a69c..cd87e6e867206a13bfdf1f5e32f4160e8bcfa39d 100644 (file)
@@ -4966,9 +4966,7 @@ static int hns_roce_v2_set_path(struct ib_qp *ibqp,
                if (ret)
                        return ret;
 
-               if (gid_attr)
-                       is_udp = (gid_attr->gid_type ==
-                                IB_GID_TYPE_ROCE_UDP_ENCAP);
+               is_udp = (gid_attr->gid_type == IB_GID_TYPE_ROCE_UDP_ENCAP);
        }
 
        /* Only HIP08 needs to set the vlan_en bits in QPC */