aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaoyue Xu <[email protected]>2022-04-09 16:32:54 +0800
committerJason Gunthorpe <[email protected]>2022-04-11 11:00:35 -0300
commit6f4f5cf9823387acc4f52e3d30f96b879acdff37 (patch)
tree51ec4a55ace04f473f1600330706e7867a63e727
parentac88da750f09c749e1c0ab0b8e5468c533704e52 (diff)
RDMA/hns: Init the variable at the suitable place
Assigning a value to ret in the init statement of a for-loop makes the code less readable. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Haoyue Xu <[email protected]> Signed-off-by: Wenpeng Liang <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_hw_v2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index 5d6da396586d..2abed0e3dfd8 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -1296,7 +1296,8 @@ static int __hns_roce_cmq_send(struct hns_roce_dev *hr_dev,
} while (++timeout < priv->cmq.tx_timeout);
if (hns_roce_cmq_csq_done(hr_dev)) {
- for (ret = 0, i = 0; i < num; i++) {
+ ret = 0;
+ for (i = 0; i < num; i++) {
/* check the result of hardware write back */
desc[i] = csq->desc[tail++];
if (tail == csq->desc_num)