common: halcc: Set info initialized even when it fails to get backend version 52/319752/3
authorYoungjae Cho <y0.cho@samsung.com>
Mon, 17 Feb 2025 08:12:52 +0000 (17:12 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Tue, 25 Feb 2025 07:21:36 +0000 (16:21 +0900)
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 <y0.cho@samsung.com>
src/hal-api-compatibility-checker.c

index 1315cddfc99b58f3d722bdd9661b4d06da99ce67..6bb357466df3af87fe98f02edfcce4294dc54699 100644 (file)
@@ -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;
 }