From: Chanwoo Choi Date: Fri, 21 Apr 2023 02:04:15 +0000 (+0900) Subject: tools: lshal: Fix wrong operation when checking flag is set or not X-Git-Tag: accepted/tizen/unified/20230424.185339^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9746f25a833ac7ac450263458e8896702f489df0;p=platform%2Fhal%2Fapi%2Fcommon.git tools: lshal: Fix wrong operation when checking flag is set or not 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 --- diff --git a/tools/lshal/lshal.c b/tools/lshal/lshal.c index fa4491b..1a25fc8 100644 --- a/tools/lshal/lshal.c +++ b/tools/lshal/lshal.c @@ -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);