[SWDEV-532125] Remove_Unused_Definitions (#385)

Signed-off-by: Narlo, Joseph <Joseph.Narlo@amd.com>
Этот коммит содержится в:
Narlo, Joseph authored and GitHub committed 2025-05-28 18:49:08 -05:00
1 родитель 7c29b4eab8
Коммит b6d638d942
10 files changed
+28 -45

No files matched your search

+7 -8
Просмотреть файл
@@ -710,17 +710,17 @@ amdsmi_get_gpu_board_info(amdsmi_processor_handle processor_handle, amdsmi_board
}
if (board_info->product_name[0] == '\0') {
status = rsmi_wrapper(rsmi_dev_name_get, processor_handle, 0,
board_info->product_name, AMDSMI_256_LENGTH);
board_info->product_name, AMDSMI_MAX_STRING_LENGTH);
// Check if the value is in hex format
if (status == AMDSMI_STATUS_SUCCESS) {
if (board_info->product_name[0] == '0' && board_info->product_name[1] == 'x') {
memset(board_info->product_name, 0,
AMDSMI_256_LENGTH * sizeof(board_info->product_name[0]));
AMDSMI_MAX_STRING_LENGTH * sizeof(board_info->product_name[0]));
}
}
if (status != AMDSMI_STATUS_SUCCESS) {
memset(board_info->product_name, 0,
AMDSMI_256_LENGTH * sizeof(board_info->product_name[0]));
AMDSMI_MAX_STRING_LENGTH * sizeof(board_info->product_name[0]));
}
}
@@ -749,17 +749,17 @@ amdsmi_get_gpu_board_info(amdsmi_processor_handle processor_handle, amdsmi_board
if (board_info->product_name[0] == '\0') {
status = rsmi_wrapper(rsmi_dev_name_get, processor_handle, 0,
board_info->product_name,
AMDSMI_256_LENGTH);
AMDSMI_MAX_STRING_LENGTH);
// Check if the value is in hex format
if (status == AMDSMI_STATUS_SUCCESS) {
if (board_info->product_name[0] == '0' && board_info->product_name[1] == 'x') {
memset(board_info->product_name, 0,
AMDSMI_256_LENGTH * sizeof(board_info->product_name[0]));
AMDSMI_MAX_STRING_LENGTH * sizeof(board_info->product_name[0]));
}
}
if (status != AMDSMI_STATUS_SUCCESS) {
memset(board_info->product_name, 0,
AMDSMI_256_LENGTH * sizeof(board_info->product_name[0]));
AMDSMI_MAX_STRING_LENGTH * sizeof(board_info->product_name[0]));
}
ss << __PRETTY_FUNCTION__ << " | [rsmi_correction] board_info->product_name= |"
<< board_info->product_name << "|";
@@ -1443,7 +1443,7 @@ amdsmi_get_gpu_asic_info(amdsmi_processor_handle processor_handle, amdsmi_asic_i
amdsmi_status_t status = smi_amdgpu_get_market_name_from_dev_id(gpu_device, info->market_name);
if (status != AMDSMI_STATUS_SUCCESS) {
rsmi_wrapper(rsmi_dev_brand_get, processor_handle, 0,
info->market_name, AMDSMI_256_LENGTH);
info->market_name, AMDSMI_MAX_STRING_LENGTH);
}
std::string render_name = gpu_device->get_gpu_path();
@@ -3546,7 +3546,6 @@ amdsmi_status_t amdsmi_get_lib_version(amdsmi_version_t *version) {
if (version == nullptr)
return AMDSMI_STATUS_INVAL;
version->year = AMDSMI_LIB_VERSION_YEAR;
version->major = AMDSMI_LIB_VERSION_MAJOR;
version->minor = AMDSMI_LIB_VERSION_MINOR;
version->release = AMDSMI_LIB_VERSION_RELEASE;
+3 -3
Просмотреть файл
@@ -659,7 +659,7 @@ amdsmi_status_t smi_amdgpu_get_market_name_from_dev_id(amd::smi::AMDSmiGPUDevice
ret = amdgpu_device_initialize(fd, &major_version, &minor_version, &device_handle);
if (ret != 0) {
std::string empty = "";
std::strncpy(market_name, empty.c_str(), AMDSMI_256_LENGTH - 1);
std::strncpy(market_name, empty.c_str(), AMDSMI_MAX_STRING_LENGTH - 1);
amdgpu_device_deinitialize(device_handle);
close(fd);
return AMDSMI_STATUS_DRM_ERROR;
@@ -668,8 +668,8 @@ amdsmi_status_t smi_amdgpu_get_market_name_from_dev_id(amd::smi::AMDSmiGPUDevice
// Get the marketing name using libdrm's API
const char *name = amdgpu_get_marketing_name(device_handle);
if (name != nullptr) {
std::strncpy(market_name, name, AMDSMI_256_LENGTH - 1);
market_name[AMDSMI_256_LENGTH - 1] = '\0';
std::strncpy(market_name, name, AMDSMI_MAX_STRING_LENGTH - 1);
market_name[AMDSMI_MAX_STRING_LENGTH - 1] = '\0';
amdgpu_device_deinitialize(device_handle);
close(fd);
libdrm_amdgpu_.AMDSmiLibraryLoader::unload();