summaryrefslogtreecommitdiff
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorLang Cheng <chenglang@huawei.com>2021-02-07 11:55:39 +0300
committerJason Gunthorpe <jgg@nvidia.com>2021-02-16 21:42:58 +0300
commit229557230c760e25b6af79709aa85d30de4c8500 (patch)
tree2dfa2fb06def0071d21c8a169a67bfe13e1e1af0 /drivers/infiniband
parent633d61021298f690f823ff51bcdab906e3644fe1 (diff)
downloadlinux-229557230c760e25b6af79709aa85d30de4c8500.tar.xz
RDMA/hns: Remove unused member and variable of CMDQ
last_status of structure hns_roce_v2_cmq has never been used, and the variable named 'complete' in __hns_roce_cmq_send() is meaningless. Fixes: a04ff739f2a9 ("RDMA/hns: Add command queue support for hip08 RoCE driver") Link: https://lore.kernel.org/r/1612688143-28226-2-git-send-email-liweihang@huawei.com Signed-off-by: Lang Cheng <chenglang@huawei.com> Signed-off-by: Weihang Li <liweihang@huawei.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_hw_v2.c9
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_hw_v2.h1
2 files changed, 3 insertions, 7 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index d9f94b454085..4bbbc240e072 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -1314,7 +1314,6 @@ static int __hns_roce_cmq_send(struct hns_roce_dev *hr_dev,
struct hns_roce_v2_priv *priv = hr_dev->priv;
struct hns_roce_v2_cmq_ring *csq = &priv->cmq.csq;
struct hns_roce_cmq_desc *desc_to_use;
- bool complete = false;
u32 timeout = 0;
int handle = 0;
u16 desc_ret;
@@ -1361,7 +1360,6 @@ static int __hns_roce_cmq_send(struct hns_roce_dev *hr_dev,
}
if (hns_roce_cmq_csq_done(hr_dev)) {
- complete = true;
handle = 0;
while (handle < num) {
/* get the result of hardware write back */
@@ -1373,16 +1371,15 @@ static int __hns_roce_cmq_send(struct hns_roce_dev *hr_dev,
ret = 0;
else
ret = -EIO;
- priv->cmq.last_status = desc_ret;
+
ntc++;
handle++;
if (ntc == csq->desc_num)
ntc = 0;
}
- }
-
- if (!complete)
+ } else {
ret = -EAGAIN;
+ }
/* clean the command send queue */
handle = hns_roce_cmq_csq_clean(hr_dev);
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.h b/drivers/infiniband/hw/hns/hns_roce_hw_v2.h
index f29438cff456..631f6798a8fd 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.h
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.h
@@ -1890,7 +1890,6 @@ struct hns_roce_v2_cmq {
struct hns_roce_v2_cmq_ring csq;
struct hns_roce_v2_cmq_ring crq;
u16 tx_timeout;
- u16 last_status;
};
enum hns_roce_link_table_type {