Projects
home:Eustace:branches:Eulaceura:Factory
libwd
_service:obs_scm:0021-wd_digest-uninit-check-st...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:0021-wd_digest-uninit-check-status-in-one-func.patch of Package libwd
From f690d2e248be5270b9cdda6f2b8af18af580ab49 Mon Sep 17 00:00:00 2001 From: Zhangfei Gao <zhangfei.gao@linaro.org> Date: Tue, 19 Mar 2024 02:42:39 +0000 Subject: [PATCH 21/44] wd_digest: uninit check status in one func To simplify code, checking status in one func Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org> --- wd_digest.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/wd_digest.c b/wd_digest.c index 10ac080..0df7204 100644 --- a/wd_digest.c +++ b/wd_digest.c @@ -296,23 +296,29 @@ out_clear_init: return ret; } -static void wd_digest_uninit_nolock(void) +static int wd_digest_uninit_nolock(void) { + enum wd_status status; + + wd_alg_get_init(&wd_digest_setting.status, &status); + if (status == WD_UNINIT) + return -WD_EINVAL; + wd_uninit_async_request_pool(&wd_digest_setting.pool); wd_clear_sched(&wd_digest_setting.sched); wd_alg_uninit_driver(&wd_digest_setting.config, wd_digest_setting.driver); + return 0; } void wd_digest_uninit(void) { - enum wd_status status; + int ret; - wd_alg_get_init(&wd_digest_setting.status, &status); - if (status == WD_UNINIT) + ret = wd_digest_uninit_nolock(); + if (ret) return; - wd_digest_uninit_nolock(); wd_digest_close_driver(); wd_alg_clear_init(&wd_digest_setting.status); } @@ -419,13 +425,12 @@ out_uninit: void wd_digest_uninit2(void) { - enum wd_status status; + int ret; - wd_alg_get_init(&wd_digest_setting.status, &status); - if (status == WD_UNINIT) + ret = wd_digest_uninit_nolock(); + if (ret) return; - wd_digest_uninit_nolock(); wd_alg_attrs_uninit(&wd_digest_init_attrs); wd_alg_drv_unbind(wd_digest_setting.driver); wd_dlclose_drv(wd_digest_setting.dlh_list); -- 2.25.1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2