From 68167b62babe3365bd0cde6d3ceeca5c7d8ce850 Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Fri, 14 Apr 2023 10:08:20 +0100 Subject: [PATCH] Runtime::GetSystemInfo: Supress parentheses warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with g++-11.3.0, I have the following warning: /home/.../core/runtime/runtime.cpp: In member function ‘hsa_status_t rocr::core::Runtime::GetSystemInfo(hsa_system_info_t, void*)’: /home/.../core/runtime/runtime.cpp:693:56: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] 693 | kfd_version.KernelInterfaceMajorVersion == 1 && | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ 694 | kfd_version.KernelInterfaceMinorVersion >= 12) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This patch adds the parenthesis as suggested. This silences the compiler warning. No functional change expected. Change-Id: I69c1a73a432b0f2393dbaf36d4424cf0056c535f [ROCm/ROCR-Runtime commit: 72219b82376844c170192c0f887d50d0d312ebcc] --- .../rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp index 74d0617495..ee095f0119 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -690,8 +690,8 @@ hsa_status_t Runtime::GetSystemInfo(hsa_system_info_t attribute, void* value) { // Implemented in KFD in 1.12 if (kfd_version.KernelInterfaceMajorVersion > 1 || - kfd_version.KernelInterfaceMajorVersion == 1 && - kfd_version.KernelInterfaceMinorVersion >= 12) + (kfd_version.KernelInterfaceMajorVersion == 1 && + kfd_version.KernelInterfaceMinorVersion >= 12)) *(reinterpret_cast(value)) = true; else *(reinterpret_cast(value)) = false;