Return an error when user tries to set out of range clock values for setsrange functionality

Signed-off-by: Divya Shikre <DivyaUday.Shikre@amd.com>
Change-Id: Ibe1075c1d2b6c009332a52b81f4b41f7e93d0756


[ROCm/rocm_smi_lib commit: 462d4adc24]
このコミットが含まれているのは:
Divya Shikre
2021-05-11 11:21:55 -04:00
committed by Divya Uday Shikre
コミット f3c90aa582
+8 -3
ファイルの表示
@@ -617,16 +617,21 @@ int Device::writeDevInfoStr(DevInfoTypes type, std::string valStr) {
std::ofstream fs;
int ret;
fs.rdbuf()->pubsetbuf(0,0);
ret = openSysfsFileStream(type, &fs, valStr.c_str());
if (ret != 0) {
return ret;
}
// We'll catch any exceptions in rocm_smi.cc code.
fs << valStr;
if (fs << valStr) {
ret = RSMI_STATUS_SUCCESS;
} else {
ret = RSMI_STATUS_NOT_SUPPORTED;
}
fs.close();
return 0;
return ret;
}
rsmi_dev_perf_level Device::perfLvlStrToEnum(std::string s) {