154 lines
4.9 KiB
Diff
154 lines
4.9 KiB
Diff
From 797031c0562786591f9837650c1521573dee356c Mon Sep 17 00:00:00 2001
|
|
From: Zhangfei Gao <zhangfei.gao@linaro.org>
|
|
Date: Wed, 24 Jan 2024 04:00:50 +0000
|
|
Subject: [PATCH 4/8] uadk_tool: fix build error
|
|
|
|
Fix build errors, like
|
|
"overlapping comparisons always evaluate to true",
|
|
"used uninitialized" etc.
|
|
|
|
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
|
|
Signed-off-by: 15859157387 <977713017@qq.com>
|
|
---
|
|
uadk_tool/benchmark/hpre_uadk_benchmark.c | 4 ++--
|
|
uadk_tool/benchmark/hpre_wd_benchmark.c | 4 ++--
|
|
uadk_tool/benchmark/sec_uadk_benchmark.c | 8 ++++----
|
|
uadk_tool/benchmark/sec_wd_benchmark.c | 8 ++++----
|
|
uadk_tool/benchmark/uadk_benchmark.c | 12 ------------
|
|
uadk_tool/benchmark/uadk_benchmark.h | 1 -
|
|
uadk_tool/test/test_sec.c | 1 -
|
|
7 files changed, 12 insertions(+), 26 deletions(-)
|
|
|
|
diff --git a/uadk_tool/benchmark/hpre_uadk_benchmark.c b/uadk_tool/benchmark/hpre_uadk_benchmark.c
|
|
index 028e102..0cbbdf2 100644
|
|
--- a/uadk_tool/benchmark/hpre_uadk_benchmark.c
|
|
+++ b/uadk_tool/benchmark/hpre_uadk_benchmark.c
|
|
@@ -2130,7 +2130,7 @@ static void *ecc_uadk_sync_run(void *arg)
|
|
memset(&req, 0, sizeof(req));
|
|
|
|
memset(&setup, 0, sizeof(setup));
|
|
- if (subtype != X448_TYPE || subtype != X25519_TYPE) {
|
|
+ if (subtype != X448_TYPE && subtype != X25519_TYPE) {
|
|
ret = get_ecc_curve(&setup, cid);
|
|
if (ret)
|
|
return NULL;
|
|
@@ -2289,7 +2289,7 @@ static void *ecc_uadk_async_run(void *arg)
|
|
memset(&req, 0, sizeof(req));
|
|
|
|
memset(&setup, 0, sizeof(setup));
|
|
- if (subtype != X448_TYPE || subtype != X25519_TYPE) {
|
|
+ if (subtype != X448_TYPE && subtype != X25519_TYPE) {
|
|
ret = get_ecc_curve(&setup, cid);
|
|
if (ret)
|
|
return NULL;
|
|
diff --git a/uadk_tool/benchmark/hpre_wd_benchmark.c b/uadk_tool/benchmark/hpre_wd_benchmark.c
|
|
index 67d57c6..2873ffd 100644
|
|
--- a/uadk_tool/benchmark/hpre_wd_benchmark.c
|
|
+++ b/uadk_tool/benchmark/hpre_wd_benchmark.c
|
|
@@ -2090,7 +2090,7 @@ static void *ecc_wd_sync_run(void *arg)
|
|
queue = g_thread_queue.bd_res[pdata->td_id].queue;
|
|
|
|
memset(&setup, 0, sizeof(setup));
|
|
- if (subtype != X448_TYPE || subtype != X25519_TYPE) {
|
|
+ if (subtype != X448_TYPE && subtype != X25519_TYPE) {
|
|
ret = get_ecc_curve(&setup, cid);
|
|
if (ret)
|
|
return NULL;
|
|
@@ -2248,7 +2248,7 @@ static void *ecc_wd_async_run(void *arg)
|
|
queue = g_thread_queue.bd_res[pdata->td_id].queue;
|
|
|
|
memset(&setup, 0, sizeof(setup));
|
|
- if (subtype != X448_TYPE || subtype != X25519_TYPE) {
|
|
+ if (subtype != X448_TYPE && subtype != X25519_TYPE) {
|
|
ret = get_ecc_curve(&setup, cid);
|
|
if (ret)
|
|
return NULL;
|
|
diff --git a/uadk_tool/benchmark/sec_uadk_benchmark.c b/uadk_tool/benchmark/sec_uadk_benchmark.c
|
|
index f1ae18b..c99ae89 100644
|
|
--- a/uadk_tool/benchmark/sec_uadk_benchmark.c
|
|
+++ b/uadk_tool/benchmark/sec_uadk_benchmark.c
|
|
@@ -148,10 +148,10 @@ static int sec_uadk_param_parse(thread_data *tddata, struct acc_option *options)
|
|
bool is_union = false;
|
|
u8 keysize = 0;
|
|
u8 ivsize = 0;
|
|
- u8 dmode;
|
|
- u8 dalg;
|
|
- u8 mode;
|
|
- u8 alg;
|
|
+ u8 dmode = 0;
|
|
+ u8 dalg = 0;
|
|
+ u8 mode = 0;
|
|
+ u8 alg = 0;
|
|
|
|
switch(algtype) {
|
|
case AES_128_ECB:
|
|
diff --git a/uadk_tool/benchmark/sec_wd_benchmark.c b/uadk_tool/benchmark/sec_wd_benchmark.c
|
|
index 6e5c8a0..aa03db8 100644
|
|
--- a/uadk_tool/benchmark/sec_wd_benchmark.c
|
|
+++ b/uadk_tool/benchmark/sec_wd_benchmark.c
|
|
@@ -214,10 +214,10 @@ static int sec_wd_param_parse(thread_data *tddata, struct acc_option *options)
|
|
bool is_union = false;
|
|
u8 keysize = 0;
|
|
u8 ivsize = 0;
|
|
- u8 dmode;
|
|
- u8 dalg;
|
|
- u8 mode;
|
|
- u8 alg;
|
|
+ u8 dmode = 0;
|
|
+ u8 dalg = 0;
|
|
+ u8 mode = 0;
|
|
+ u8 alg = 0;
|
|
|
|
switch(algtype) {
|
|
case AES_128_ECB:
|
|
diff --git a/uadk_tool/benchmark/uadk_benchmark.c b/uadk_tool/benchmark/uadk_benchmark.c
|
|
index 6d5d009..cf3a93c 100644
|
|
--- a/uadk_tool/benchmark/uadk_benchmark.c
|
|
+++ b/uadk_tool/benchmark/uadk_benchmark.c
|
|
@@ -364,18 +364,6 @@ int get_pid_cpu_time(u32 *ptime)
|
|
return 0;
|
|
}
|
|
|
|
-void mdelay(u32 ms)
|
|
-{
|
|
- int clock_tcy = 2600000000; // 2.6Ghz CPU;
|
|
- int i;
|
|
-
|
|
- while(ms) {
|
|
- i++;
|
|
- if (i == clock_tcy)
|
|
- ms--;
|
|
- }
|
|
-}
|
|
-
|
|
static void alarm_end(int sig)
|
|
{
|
|
if (sig == SIGALRM) {
|
|
diff --git a/uadk_tool/benchmark/uadk_benchmark.h b/uadk_tool/benchmark/uadk_benchmark.h
|
|
index 1cce63d..1752948 100644
|
|
--- a/uadk_tool/benchmark/uadk_benchmark.h
|
|
+++ b/uadk_tool/benchmark/uadk_benchmark.h
|
|
@@ -198,7 +198,6 @@ enum test_alg {
|
|
ALG_MAX,
|
|
};
|
|
|
|
-extern void mdelay(u32 ms);
|
|
extern int get_pid_cpu_time(u32 *ptime);
|
|
extern void cal_perfermance_data(struct acc_option *option, u32 sttime);
|
|
extern void time_start(u32 seconds);
|
|
diff --git a/uadk_tool/test/test_sec.c b/uadk_tool/test/test_sec.c
|
|
index b00a933..16feaf0 100644
|
|
--- a/uadk_tool/test/test_sec.c
|
|
+++ b/uadk_tool/test/test_sec.c
|
|
@@ -60,7 +60,6 @@ static unsigned int g_ctxnum;
|
|
static unsigned int g_data_fmt = WD_FLAT_BUF;
|
|
static unsigned int g_sgl_num = 0;
|
|
static unsigned int g_init;
|
|
-static pthread_spinlock_t lock = 0;
|
|
|
|
static struct hash_testvec g_long_hash_tv;
|
|
|
|
--
|
|
2.25.1
|
|
|