tools: lshal: Fix wrong operation when checking flag is set or not 57/291757/1 accepted/tizen/unified/20230424.185339
authorChanwoo Choi <cw00.choi@samsung.com>
Fri, 21 Apr 2023 02:04:15 +0000 (11:04 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Fri, 21 Apr 2023 02:04:15 +0000 (11:04 +0900)
When using bit operation for flag, should use 'and' operation.
But, lshal.c used the wrong operation. It fix the operatin from 'or' to
'and'.

Change-Id: I3a2badb8c61f73a6fc8d98b737fa6d7d4134c9eb
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
tools/lshal/lshal.c

index fa4491b..1a25fc8 100644 (file)
@@ -101,7 +101,7 @@ static void lshal_print_hal_backend_info(u_int32_t flags) {
        lshal_print_border();
 
        for (module = HAL_MODULE_UNKNOWN + 1; module < HAL_MODULE_END; module++) {
-               if (LSHAL_FLAG_BACKEND_MODULE_NAME | flags) {
+               if (LSHAL_FLAG_BACKEND_MODULE_NAME & flags) {
                        strncpy(str, "", BUFF_MAX - 1);
 
                        ret = hal_common_get_backend_module_name(module, str, BUFF_MAX - 1);
@@ -111,7 +111,7 @@ static void lshal_print_hal_backend_info(u_int32_t flags) {
                                printf(" %-38s | %-2d |", str, module);
                }
 
-               if (LSHAL_FLAG_BACKEND_LIB_NAME | flags) {
+               if (LSHAL_FLAG_BACKEND_LIB_NAME & flags) {
                        strncpy(str, "", BUFF_MAX - 1);
 
                        ret = hal_common_get_backend_library_name(module, str, BUFF_MAX - 1);
@@ -121,7 +121,7 @@ static void lshal_print_hal_backend_info(u_int32_t flags) {
                                printf(" %-55s |", str);
                }
 
-               if (LSHAL_FLAG_BACKEND_USAGE_COUNT | flags) {
+               if (LSHAL_FLAG_BACKEND_USAGE_COUNT & flags) {
                        int count = hal_common_get_backend_count(module);
                        if (count < 0)
                                printf(" %-10s |", "");
@@ -129,7 +129,7 @@ static void lshal_print_hal_backend_info(u_int32_t flags) {
                                printf(" %-10d |", count);
                }
 
-               if (LSHAL_FLAG_BACKEND_VERIFICATION | flags) {
+               if (LSHAL_FLAG_BACKEND_VERIFICATION & flags) {
                        ret = lshal_verify_hal_backend(module);
 
                        if (ret == -ENOENT) {
@@ -142,7 +142,7 @@ static void lshal_print_hal_backend_info(u_int32_t flags) {
                        }
                }
 
-               if (LSHAL_FLAG_BACKEND_SYMBOL_NAME | flags) {
+               if (LSHAL_FLAG_BACKEND_SYMBOL_NAME & flags) {
                        strncpy(str, "", BUFF_MAX - 1);
 
                        ret = hal_common_get_backend_symbol_name(module, str, BUFF_MAX - 1);
@@ -152,7 +152,7 @@ static void lshal_print_hal_backend_info(u_int32_t flags) {
                                printf(" %-45s |", str);
                }
 
-               if (LSHAL_FLAG_BACKEND_ABI_VERSION | flags) {
+               if (LSHAL_FLAG_BACKEND_ABI_VERSION & flags) {
                        strncpy(str, "", BUFF_MAX - 1);
 
                        ret = hal_common_get_backend_abi_version(module);
@@ -162,7 +162,7 @@ static void lshal_print_hal_backend_info(u_int32_t flags) {
                                printf(" %-25s |", hal_abi_version_str[ret]);
                }
 
-               if (LSHAL_FLAG_BACKEND_NAME | flags) {
+               if (LSHAL_FLAG_BACKEND_NAME & flags) {
                        strncpy(str, "", BUFF_MAX - 1);
 
                        ret = hal_common_get_backend_name(module, str, BUFF_MAX - 1);
@@ -172,7 +172,7 @@ static void lshal_print_hal_backend_info(u_int32_t flags) {
                                printf(" %-25s |", str);
                }
 
-               if (LSHAL_FLAG_BACKEND_VENDOR_NAME | flags) {
+               if (LSHAL_FLAG_BACKEND_VENDOR_NAME & flags) {
                        strncpy(str, "", BUFF_MAX - 1);
 
                        ret = hal_common_get_backend_vendor(module, str, BUFF_MAX - 1);