未验证 提交 c0a502be 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!1201 [sync] PR-1144: crypto: hisilicon/qm: modify loop exit condition

Merge Pull Request from: @openeuler-sync-bot 
 

Origin pull request: 
https://gitee.com/openeuler/kernel/pulls/1144 
 
Loop branch using 'i++' as condition will cause the loop to not execute
when 'i == 0', should use '++i', Fix it.

issue: https://gitee.com/openeuler/kernel/issues/I7DUYJ 
 
Link:https://gitee.com/openeuler/kernel/pulls/1201 

Reviewed-by: Yang Shen <shenyang39@huawei.com> 
Signed-off-by: Jialin Zhang <zhangjialin11@huawei.com> 
...@@ -104,7 +104,7 @@ static int qm_wait_mb_finish(struct hisi_qm *qm, struct qm_mailbox *mailbox) ...@@ -104,7 +104,7 @@ static int qm_wait_mb_finish(struct hisi_qm *qm, struct qm_mailbox *mailbox)
{ {
int i = 0; int i = 0;
while (i++) { while (++i) {
qm_mb_read(qm, mailbox); qm_mb_read(qm, mailbox);
if (!((le16_to_cpu(mailbox->w0) >> QM_MB_BUSY_SHIFT) & 0x1)) if (!((le16_to_cpu(mailbox->w0) >> QM_MB_BUSY_SHIFT) & 0x1))
break; break;
......
...@@ -666,7 +666,7 @@ static int qm_wait_mb_finish(struct hisi_qm *qm, struct qm_mailbox *mailbox) ...@@ -666,7 +666,7 @@ static int qm_wait_mb_finish(struct hisi_qm *qm, struct qm_mailbox *mailbox)
{ {
int i = 0; int i = 0;
while (i++) { while (++i) {
qm_mb_read(qm, mailbox); qm_mb_read(qm, mailbox);
if (!((le16_to_cpu(mailbox->w0) >> QM_MB_BUSY_SHIFT) & 0x1)) if (!((le16_to_cpu(mailbox->w0) >> QM_MB_BUSY_SHIFT) & 0x1))
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册