halapi: common: Change variable name for improving the readability 85/251185/3 accepted/tizen/unified/20210111.125423 submit/tizen/20210111.072925
authorChanwoo Choi <cw00.choi@samsung.com>
Mon, 11 Jan 2021 06:00:55 +0000 (15:00 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 11 Jan 2021 06:31:42 +0000 (15:31 +0900)
Change the variable name for improving the readability
because prior defined variable name is vague to pass
the correct meaning of version. So that change the name as following
in order to improve the readability and understanding.

[Chagned variable names]
- g_curr_hal_abi_version -> g_platform_curr_abi_version
- current_version -> platform_abi_version
- compat_version -> backend_min_abi_version

Change-Id: I733b203a6c0fe058dedb6e9e26f832a0629ccc15
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/common.h
src/hal-api-common.c

index 39ab920..7f9dadf 100644 (file)
  * and HAL backend package like hal-backend-audio-*.rpm which is included
  * in hal.img. In order to compare ABI version between two binary,
  * Tizen core platform always must maintain the current HAL ABI version.
- * So that, define the below global variable (g_curr_hal_abi_version).
+ * So that, define the below global variable (g_platform_curr_abi_version).
  *
- * 'g_curr_hal_abi_version' will be used for all HAL API modules,
+ * 'g_platform_curr_abi_version' will be used for all HAL API modules,
  * to check whether HAL backend ABI version of each module in hal.img
  * is supported or not with current Tizen core HAL ABI version.
  *
- * 'g_curr_hal_abi_version' must be updated when Tizen platform will be released
- * officially.
+ * 'g_platform_curr_abi_version' must be updated when Tizen platform
+ * will be released officially.
  */
 /* FIXME: Need to be initialized by configuration file like xml */
-enum hal_abi_version g_curr_hal_abi_version = HAL_ABI_VERSION_TIZEN_6_5;
+enum hal_abi_version g_platform_curr_abi_version = HAL_ABI_VERSION_TIZEN_6_5;
 
 struct hal_abi_version_match {
-       enum hal_abi_version curr_version;
-       enum hal_abi_version compat_version;
+       enum hal_abi_version platform_abi_version;
+       enum hal_abi_version backend_min_abi_version;
 } abi_version_match_data[HAL_MODULE_END][HAL_ABI_VERSION_MAX] = {
        /* HAL_GROUP_GRAPHICS */
        [HAL_MODULE_TBM] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
        [HAL_MODULE_TDM] = {
                /* FIXME: Need to be filled from configuration file. */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
        [HAL_MODULE_COREGL] = {
@@ -84,22 +84,22 @@ struct hal_abi_version_match {
        [HAL_MODULE_AUDIO] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
        [HAL_MODULE_CAMERA] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
        [HAL_MODULE_RADIO] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
        [HAL_MODULE_CODEC] = {
@@ -125,15 +125,15 @@ struct hal_abi_version_match {
        [HAL_MODULE_BLUETOOTH] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
        [HAL_MODULE_WIFI] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
        [HAL_MODULE_NAN] = {
@@ -141,22 +141,22 @@ struct hal_abi_version_match {
        [HAL_MODULE_NFC] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
        [HAL_MODULE_ZIGBEE] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
        [HAL_MODULE_UWB] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
        [HAL_MODULE_MTP] = {
@@ -170,8 +170,8 @@ struct hal_abi_version_match {
        [HAL_MODULE_TELPEPHONY] = {
                /* FIXME: Need to be determined whehter support HAL API or not. */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
 
@@ -179,8 +179,8 @@ struct hal_abi_version_match {
        [HAL_MODULE_LOCATION] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
 
@@ -190,100 +190,100 @@ struct hal_abi_version_match {
        [HAL_MODULE_POWER] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
        [HAL_MODULE_SENSOR] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
        [HAL_MODULE_PERIPHERAL] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
 
        [HAL_MODULE_DEVICE_BATTERY] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
        [HAL_MODULE_DEVICE_BEZEL] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
        [HAL_MODULE_DEVICE_DISPLAY] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
        [HAL_MODULE_DEVICE_IR] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
        [HAL_MODULE_DEVICE_TOUCHSCREEN] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
        [HAL_MODULE_DEVICE_LED] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
        [HAL_MODULE_DEVICE_BOARD] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
        [HAL_MODULE_DEVICE_EXTERNAL_CONNECTION] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
        [HAL_MODULE_DEVICE_THERMAL] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
        [HAL_MODULE_DEVICE_USB_GADGET] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
        [HAL_MODULE_DEVICE_HAPTIC] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
 
@@ -292,8 +292,8 @@ struct hal_abi_version_match {
        [HAL_MODULE_FOO] = {
                /* FIXME: Need to be initialized by configuration file like xml */
                [0] = {
-                       .curr_version   = HAL_ABI_VERSION_TIZEN_6_5,
-                       .compat_version = HAL_ABI_VERSION_TIZEN_6_5,
+                       .platform_abi_version   = HAL_ABI_VERSION_TIZEN_6_5,
+                       .backend_min_abi_version        = HAL_ABI_VERSION_TIZEN_6_5,
                },
        },
 };
index 61ef60c..896691c 100644 (file)
@@ -216,18 +216,18 @@ int hal_common_check_backend_abi_version(enum hal_module module,
                struct hal_abi_version_match *data
                                = &hal_module_info[module].abi_versions[i];
 
-               if (g_curr_hal_abi_version != data->curr_version)
+               if (g_platform_curr_abi_version != data->platform_abi_version)
                        continue;
 
-               if (abi_version <= data->curr_version
-                               && abi_version >= data->compat_version)
+               if (abi_version <= data->platform_abi_version
+                               && abi_version >= data->backend_min_abi_version)
                        return TIZEN_ERROR_NONE;
 
-               _E("%s doesn't support %s of HAL Backend\n", hal_abi_version_str[g_curr_hal_abi_version],
+               _E("%s doesn't support %s of HAL Backend\n", hal_abi_version_str[g_platform_curr_abi_version],
                                hal_abi_version_str[abi_version]);
                _E("Must use the following ABI versions from %s to %s\n",
-                               hal_abi_version_str[data->compat_version],
-                               hal_abi_version_str[data->curr_version]);
+                               hal_abi_version_str[data->backend_min_abi_version],
+                               hal_abi_version_str[data->platform_abi_version]);
        }
 
        return TIZEN_ERROR_INVALID_PARAMETER;