From: Zhiqi Song songzhiqi1@huawei.com
Modify the definition method of alg_name when passing it to wd_xxx_init2() function, fixing the compile waring: 'discards 'const' qulifier from pointer type'.
Signed-off-by: Zhiqi Song songzhiqi1@huawei.com --- src/uadk_prov_dh.c | 3 ++- src/uadk_prov_rsa.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/uadk_prov_dh.c b/src/uadk_prov_dh.c index a6a20a8..e5c956c 100644 --- a/src/uadk_prov_dh.c +++ b/src/uadk_prov_dh.c @@ -583,12 +583,13 @@ static void uadk_prov_dh_mutex_infork(void)
static int uadk_prov_dh_init(void) { + char alg_name[] = "dh"; int ret;
pthread_atfork(NULL, NULL, uadk_prov_dh_mutex_infork); pthread_mutex_lock(&dh_mutex); if (g_dh_prov.pid != getpid()) { - ret = wd_dh_init2("dh", SCHED_POLICY_RR, TASK_HW); + ret = wd_dh_init2(alg_name, SCHED_POLICY_RR, TASK_HW); if (unlikely(ret)) { pthread_mutex_unlock(&dh_mutex); return ret; diff --git a/src/uadk_prov_rsa.c b/src/uadk_prov_rsa.c index 563a0e5..9872b27 100644 --- a/src/uadk_prov_rsa.c +++ b/src/uadk_prov_rsa.c @@ -1024,12 +1024,13 @@ static void uadk_rsa_mutex_infork(void)
static int uadk_prov_rsa_init(void) { + char alg_name[] = "rsa"; int ret;
pthread_atfork(NULL, NULL, uadk_rsa_mutex_infork); pthread_mutex_lock(&rsa_mutex); if (g_rsa_prov.pid != getpid()) { - ret = wd_rsa_init2("rsa", SCHED_POLICY_RR, TASK_MIX); + ret = wd_rsa_init2(alg_name, SCHED_POLICY_RR, TASK_MIX); if (unlikely(ret)) { pthread_mutex_unlock(&rsa_mutex); return ret;