From: Youngjae Cho Date: Mon, 17 Feb 2025 08:12:52 +0000 (+0900) Subject: common: halcc: Set info initialized even when it fails to get backend version X-Git-Tag: accepted/tizen/unified/20250226.102358~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6b39d6bb2bc2358406bd4787e9a052e8fa764981;p=platform%2Fhal%2Fapi%2Fcommon.git common: halcc: Set info initialized even when it fails to get backend version If it once fails to get backend version, then all the following calls for the backend version will fail as well, leaving it uninitialized. Due to this, the hal-api-common repeatedly try to initialize it for every call for accessing the backend, which is truely inefficiet. This is because this kind of failure cannot be recovered during runtime. Therefore, it is enough to set it as initialized even when it fails and let the following calls not to take same routine repeatedly but just immediately return if it has once failed. Change-Id: I81f6abbadaad9f0cb44849d04135f009127e4dc7 Signed-off-by: Youngjae Cho --- diff --git a/src/hal-api-compatibility-checker.c b/src/hal-api-compatibility-checker.c index 1315cdd..6bb3574 100644 --- a/src/hal-api-compatibility-checker.c +++ b/src/hal-api-compatibility-checker.c @@ -159,13 +159,14 @@ static void __convert_hal_to_info(void *data_hal, void *data_info, bool skip_ver info->compatibility = HAL_COMMON_BACKEND_COMPATIBILITY_UNKNOWN; ret = hal_common_get_backend_version(module, &major, &minor); if (ret < 0) - return; + goto out; if (halcc_hal_is_compatible_with_version(hal, major, minor)) info->compatibility = HAL_COMMON_BACKEND_COMPATIBILITY_COMPATIBLE; else info->compatibility = HAL_COMMON_BACKEND_COMPATIBILITY_INCOMPATIBLE; +out: info->initialized = true; }