libwd/0150-uadk-fix-function-params-usage.patch
Yang Shen ec2f993b84 libwd: backport for uadk from 2.3.31 to 2.3.36
Update some patch for uadk from mainline.
To get more information, please visit the homepage:
https://github.comp/Linaro/uadk

Signed-off-by: Yang Shen <shenyang39@huawei.com>
2022-07-28 15:32:23 +08:00

61 lines
1.4 KiB
Diff

From 1e1b1fce4977f41f1cb1a86d22aca43a18531efc Mon Sep 17 00:00:00 2001
From: Wenkai Lin <linwenkai6@hisilicon.com>
Date: Sat, 23 Jul 2022 16:50:32 +0800
Subject: [PATCH 165/183] uadk: fix function params usage
parameter 'expt' of function 'wd_rsa_poll_ctx'
should not be used as working variable.
Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com>
---
v1/wd_ecc.c | 5 +++--
wd_rsa.c | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/v1/wd_ecc.c b/v1/wd_ecc.c
index c2a5100..e108051 100644
--- a/v1/wd_ecc.c
+++ b/v1/wd_ecc.c
@@ -269,14 +269,15 @@ static void init_dtb_param(void *dtb, char *start,
__u32 dsz, __u32 bsz, __u32 num)
{
struct wd_dtb *tmp = dtb;
+ char *pos = start;
int i = 0;
while (i++ < num) {
- tmp->data = start;
+ tmp->data = pos;
tmp->dsize = dsz;
tmp->bsize = bsz;
tmp += 1;
- start += bsz;
+ pos += bsz;
}
}
diff --git a/wd_rsa.c b/wd_rsa.c
index 89d3450..fb2b6b0 100644
--- a/wd_rsa.c
+++ b/wd_rsa.c
@@ -356,6 +356,7 @@ int wd_rsa_poll_ctx(__u32 idx, __u32 expt, __u32 *count)
struct wd_rsa_req *req;
struct wd_rsa_msg recv_msg, *msg;
__u32 rcv_cnt = 0;
+ __u32 tmp = expt;
int ret;
if (unlikely(!count)) {
@@ -395,7 +396,7 @@ int wd_rsa_poll_ctx(__u32 idx, __u32 expt, __u32 *count)
req->cb(req);
wd_put_msg_to_pool(&wd_rsa_setting.pool, idx, recv_msg.tag);
*count = rcv_cnt;
- } while (--expt);
+ } while (--tmp);
return ret;
}
--
2.27.0