projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ac88da7
)
RDMA/hns: Init the variable at the suitable place
author
Haoyue Xu
<xuhaoyue1@hisilicon.com>
Sat, 9 Apr 2022 08:32:54 +0000
(16:32 +0800)
committer
Jason Gunthorpe
<jgg@nvidia.com>
Mon, 11 Apr 2022 14:00:35 +0000
(11:00 -0300)
Assigning a value to ret in the init statement of a for-loop makes the
code less readable.
Link:
https://lore.kernel.org/r/20220409083254.9696-6-liangwenpeng@huawei.com
Signed-off-by: Haoyue Xu <xuhaoyue1@hisilicon.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
patch
|
blob
|
history
diff --git
a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index 5d6da396586d7728f65955cd071e8bf393e06ec1..2abed0e3dfd80af97b3708bd12c44c5d288b4b95 100644
(file)
--- 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)