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
Tento commit je obsažen v:
Divya Shikre authored and Divya Uday Shikre committed 2021-05-11 12:32:19 -04:00
1 rodič 14201290a2
revize 462d4adc24
1 file changed
+8 -3
+8 -3
Zobrazit soubor
@@ -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) {