fix(sysman): Minor fixes to RAS module

- check for empty set

Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@intel.com>
This commit is contained in:
Aravind Gopalakrishnan 2023-05-17 00:04:46 +00:00 committed by Compute-Runtime-Automation
parent 546318d258
commit 7b27d7cf41
2 changed files with 6 additions and 1 deletions

View File

@ -33,8 +33,12 @@ void RasHandleContext::init(uint32_t subDeviceCount) {
const auto isSubDevice = (subDeviceCount > 0); const auto isSubDevice = (subDeviceCount > 0);
uint32_t subDeviceCountLimit = (isSubDevice) ? subDeviceCount - 1 : 0; uint32_t subDeviceCountLimit = (isSubDevice) ? subDeviceCount - 1 : 0;
for (uint32_t subDeviceId = 0; subDeviceId <= subDeviceCountLimit; subDeviceId++) { for (uint32_t subDeviceId = 0; subDeviceId <= subDeviceCountLimit; subDeviceId++) {
std::set<zes_ras_error_type_t> errorTypeSubDev = {}; std::set<zes_ras_error_type_t> errorTypeSubDev;
OsRas::getSupportedRasErrorTypes(errorTypeSubDev, pOsSysman, isSubDevice, subDeviceId); OsRas::getSupportedRasErrorTypes(errorTypeSubDev, pOsSysman, isSubDevice, subDeviceId);
if (errorTypeSubDev.size() == 0) {
return;
}
int32_t typeId = 0; int32_t typeId = 0;
for (const auto &type : errorTypeSubDev) { for (const auto &type : errorTypeSubDev) {
createHandle(type, isSubDevice, subDeviceId); createHandle(type, isSubDevice, subDeviceId);

View File

@ -28,6 +28,7 @@ class Ras : _zes_ras_handle_t {
static Ras *fromHandle(zes_ras_handle_t handle) { static Ras *fromHandle(zes_ras_handle_t handle) {
return static_cast<Ras *>(handle); return static_cast<Ras *>(handle);
} }
inline zes_ras_handle_t toHandle() { return this; } inline zes_ras_handle_t toHandle() { return this; }
bool isRasErrorSupported = false; bool isRasErrorSupported = false;
zes_ras_error_type_t rasErrorType{}; zes_ras_error_type_t rasErrorType{};