change sensor_type in amdsmi_dev_get_temp_metric() to enum

The sensor_type in amdsmi_dev_get_temp_metric() will be changed to
amdsmi_temperature_type_t

Change-Id: I72a7f271b0a55a025acc2ca523062a3d51cc036d
This commit is contained in:
Bill(Shuzhou) Liu
2023-01-04 12:30:11 -06:00
parent 2184d0c3d7
commit 79bd9c1d5f
8 changed files with 13 additions and 11 deletions
@@ -229,7 +229,7 @@ void TestMutualExclusion::Run(void) {
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_get_fan_speed_max(device_handles_[0], 0, &dmy_ui64);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_get_temp_metric(device_handles_[0], dmy_ui32, AMDSMI_TEMP_CURRENT, &dmy_i64);
ret = amdsmi_dev_get_temp_metric(device_handles_[0], TEMPERATURE_TYPE_EDGE, AMDSMI_TEMP_CURRENT, &dmy_i64);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_reset_fan(device_handles_[0], 0);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
+3 -3
View File
@@ -114,7 +114,7 @@ void TestTempRead::Run(void) {
auto print_temp_metric = [&](amdsmi_temperature_metric_t met,
std::string label) {
err = amdsmi_dev_get_temp_metric(device_handles_[i], type, met, &val_i64);
err = amdsmi_dev_get_temp_metric(device_handles_[i], static_cast<amdsmi_temperature_type_t>(type), met, &val_i64);
if (err != AMDSMI_STATUS_SUCCESS) {
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
@@ -124,7 +124,7 @@ void TestTempRead::Run(void) {
}
// Verify api support checking functionality is working
err = amdsmi_dev_get_temp_metric(device_handles_[i], type, met, nullptr);
err = amdsmi_dev_get_temp_metric(device_handles_[i], static_cast<amdsmi_temperature_type_t>(type), met, nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
return;
} else {
@@ -132,7 +132,7 @@ void TestTempRead::Run(void) {
}
}
// Verify api support checking functionality is working
err = amdsmi_dev_get_temp_metric(device_handles_[i], type, met, nullptr);
err = amdsmi_dev_get_temp_metric(device_handles_[i], static_cast<amdsmi_temperature_type_t>(type), met, nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
IF_VERB(STANDARD) {