common: Use default library name if the given one matches the default 72/319572/1
authorYoungjae Cho <y0.cho@samsung.com>
Wed, 12 Feb 2025 07:40:13 +0000 (16:40 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Thu, 13 Feb 2025 04:10:15 +0000 (13:10 +0900)
The hal_common_get_backend_with_library() can give a library name
that is totally the same as the default one. If then, use the default
one and do not make hashtable entry for the same given one.

Change-Id: I0ba489ec815167b03f12ad2fb6eab3cf4bf8f0ca
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/hal-api-conf.c

index e373ef1bd04c4a623877635565f58a4607a1516c..ab19bdf708a58a5476304828ddab4d6658ace963 100644 (file)
@@ -79,6 +79,14 @@ static struct __hal_module_info* _get_module_info_with_library_name(enum hal_mod
                                tmp_info->module_name);
                return NULL;
        }
+
+#if defined(__aarch64__) || defined(__x86_64__) || defined (__riscv)
+       if (g_strcmp0(library_name, tmp_info->library_name_64bit) == 0)
+#else
+       if (g_strcmp0(library_name, tmp_info->library_name) == 0)
+#endif
+               return tmp_info;
+
        library_name_prefix = g_strdup_printf("libhal-backend-%s",
                                tmp_info->backend_module_name);
        if (!library_name_prefix) {