RDMA/hns: Optimize hns_roce_alloc_vf_resource()
authorLijun Ou <oulijun@huawei.com>
Fri, 20 Mar 2020 03:23:36 +0000 (11:23 +0800)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 26 Mar 2020 19:52:27 +0000 (16:52 -0300)
commit99e713f8daf8e0ddb728ba543a05a2b67d8c47cc
tree625db10304bff7c00167f0b6f1b26fdc0b6ace04
parentd398d4ca5f17e7ba762bc897c82afca868e47a7c
RDMA/hns: Optimize hns_roce_alloc_vf_resource()

The capbilities of hardware should be got at first and then used in
hns_roce_alloc_vf_resource(). Also removes an unnecessary if ... else
condition in it.

Link: https://lore.kernel.org/r/1584674622-52773-5-git-send-email-liweihang@huawei.com
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hns/hns_roce_hw_v2.c