RAS formatting changed, so get it to handle both types of sysfs output
until it's normalized
Change-Id: I56f2a2495af8ff4d01011bc614283376afb9ad0a
This commit is contained in:
Kent Russell
2019-08-08 09:00:22 -04:00
rodzic 0da1599c4f
commit a34832f11e
3 zmienionych plików z 14 dodań i 5 usunięć
+5 -1
Wyświetl plik
@@ -70,6 +70,8 @@ static const char * kRasErrStateStrings[] = {
"Single, Correctable", // RSMI_RAS_ERR_STATE_SING_C
"Multiple, Uncorrectable", // RSMI_RAS_ERR_STATE_MULT_UC
"Poison" // RSMI_RAS_ERR_STATE_POISON
"off", // RSMI_RAS_ERR_STATE_DISABLED
"on", // RSMI_RAS_ERR_STATE_ENABLED
};
static_assert(
sizeof(kRasErrStateStrings)/sizeof(char *) == (RSMI_RAS_ERR_STATE_LAST + 1),
@@ -89,8 +91,10 @@ static const std::map<rsmi_ras_err_state_t, const char *> kErrStateNameMap = {
kRasErrStateStrings[RSMI_RAS_ERR_STATE_MULT_UC]},
{RSMI_RAS_ERR_STATE_POISON,
kRasErrStateStrings[RSMI_RAS_ERR_STATE_POISON]},
{RSMI_RAS_ERR_STATE_ENABLED,
kRasErrStateStrings[RSMI_RAS_ERR_STATE_ENABLED]},
};
static_assert(RSMI_RAS_ERR_STATE_LAST == RSMI_RAS_ERR_STATE_POISON,
static_assert(RSMI_RAS_ERR_STATE_LAST == RSMI_RAS_ERR_STATE_ENABLED,
"kErrStateNameMap needs to be updated");
static const struct option long_options[] = {