提交 bebdb83f 编写于 作者: L Lang Cheng 提交者: Doug Ledford

RDMA/hns: Refactor irq request code

Remove unnecessary if...else..., to make the code look simpler.
Signed-off-by: NLang Cheng <chenglang@huawei.com>
Link: https://lore.kernel.org/r/1565276034-97329-10-git-send-email-oulijun@huawei.comSigned-off-by: NDoug Ledford <dledford@redhat.com>
上级 e7f40440
...@@ -5749,18 +5749,19 @@ static int __hns_roce_request_irq(struct hns_roce_dev *hr_dev, int irq_num, ...@@ -5749,18 +5749,19 @@ static int __hns_roce_request_irq(struct hns_roce_dev *hr_dev, int irq_num,
} }
/* irq contains: abnormal + AEQ + CEQ */ /* irq contains: abnormal + AEQ + CEQ */
for (j = 0; j < irq_num; j++) for (j = 0; j < other_num; j++)
if (j < other_num) snprintf((char *)hr_dev->irq_names[j],
snprintf((char *)hr_dev->irq_names[j], HNS_ROCE_INT_NAME_LEN, "hns-abn-%d", j);
HNS_ROCE_INT_NAME_LEN, "hns-abn-%d", j);
else if (j < (other_num + aeq_num)) for (j = other_num; j < (other_num + aeq_num); j++)
snprintf((char *)hr_dev->irq_names[j], snprintf((char *)hr_dev->irq_names[j],
HNS_ROCE_INT_NAME_LEN, "hns-aeq-%d", HNS_ROCE_INT_NAME_LEN, "hns-aeq-%d",
j - other_num); j - other_num);
else
snprintf((char *)hr_dev->irq_names[j], for (j = (other_num + aeq_num); j < irq_num; j++)
HNS_ROCE_INT_NAME_LEN, "hns-ceq-%d", snprintf((char *)hr_dev->irq_names[j],
j - other_num - aeq_num); HNS_ROCE_INT_NAME_LEN, "hns-ceq-%d",
j - other_num - aeq_num);
for (j = 0; j < irq_num; j++) { for (j = 0; j < irq_num; j++) {
if (j < other_num) if (j < other_num)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册