
Modify static check warning of clangtidy tool: parameters of function should not be used as working variable. Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com> --- src/uadk_cipher.c | 9 +++++---- src/uadk_ec.c | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/uadk_cipher.c b/src/uadk_cipher.c index e74a8c8..d5c074e 100644 --- a/src/uadk_cipher.c +++ b/src/uadk_cipher.c @@ -749,17 +749,18 @@ static void ctr_iv_inc(uint8_t *counter, __u32 c) { uint32_t n = CTR_128BIT_COUNTER; uint8_t *counter1 = counter; + __u32 c_value = c; /* * Since the counter has been increased 1 by the hardware, * so the c need to decrease 1. */ - c = c - 1; + c_value -= 1; do { --n; - c += counter1[n]; - counter1[n] = (uint8_t)c; - c >>= BYTE_BITS; + c_value += counter1[n]; + counter1[n] = (uint8_t)c_value; + c_value >>= BYTE_BITS; } while (n); } diff --git a/src/uadk_ec.c b/src/uadk_ec.c index 2ed5755..e9bbda7 100644 --- a/src/uadk_ec.c +++ b/src/uadk_ec.c @@ -72,14 +72,15 @@ static void init_dtb_param(void *dtb, char *start, __u32 dsz, __u32 bsz, __u32 num) { struct wd_dtb *tmp = dtb; + char *buff = start; int i = 0; while (i++ < num) { - tmp->data = start; + tmp->data = buff; tmp->dsize = dsz; tmp->bsize = bsz; tmp += 1; - start += bsz; + buff += bsz; } } -- 2.30.0