From db32cd13e78e12a023dc6481fb2750044482bb3f Mon Sep 17 00:00:00 2001 From: "Narlo, Joseph" Date: Wed, 5 Mar 2025 08:35:08 -0600 Subject: [PATCH] [SWDEV-501997] Build/Compiler warnings Part2 (#149) Signed-off-by: Joseph Narlo --- src/amd_smi/amd_smi.cc | 3 ++- src/amd_smi/amd_smi_drm.cc | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/amd_smi/amd_smi.cc b/src/amd_smi/amd_smi.cc index 31e8ddba65..a334f1e3d8 100644 --- a/src/amd_smi/amd_smi.cc +++ b/src/amd_smi/amd_smi.cc @@ -3317,7 +3317,8 @@ amdsmi_get_gpu_process_list(amdsmi_processor_handle processor_handle, uint32_t * } amdsmi_status_t -amdsmi_get_power_info(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, amdsmi_power_info_t *info) { +amdsmi_get_power_info(amdsmi_processor_handle processor_handle, __attribute__((unused)) uint32_t sensor_ind, amdsmi_power_info_t *info) { + AMDSMI_CHECK_INIT(); if (info == nullptr) { diff --git a/src/amd_smi/amd_smi_drm.cc b/src/amd_smi/amd_smi_drm.cc index c007c0983d..211c5c1bed 100644 --- a/src/amd_smi/amd_smi_drm.cc +++ b/src/amd_smi/amd_smi_drm.cc @@ -171,9 +171,7 @@ amdsmi_status_t AMDSmiDrm::init() { bdf.function_number = ((bdf_rocm & 0x7)); bdf.device_number = ((bdf_rocm & 0xF8) >> 3); bdf.bus_number = ((bdf_rocm & 0xFF00) >> 8); - // TODO: This is throwing a compiler warning since bdf.domain_number is part of a struct - // and is 48 bits long and throws a conversion warning - bdf.domain_number = ((bdf_rocm & 0xFFFFFFFF00000000) >> 32); + bdf.domain_number = static_cast(((bdf_rocm & 0xFFFFFFFF00000000) >> 32)); ss << __PRETTY_FUNCTION__ << " | " << "Received bdf: Domain = " << bdf.domain_number << "; Bus# = " << bdf.bus_number << "; Device# = "<< bdf.device_number << "; Function# = " << bdf.function_number;