fru: replace magic return codes with macros

Use the return code macros instead of magic numbers.

Signed-off-by: Patrick Venture <venture@google.com>
This commit is contained in:
Patrick Venture 2018-12-28 07:31:16 -08:00 committed by Alexander Amelkin
parent f64044a3de
commit be3d57c013

View File

@ -611,8 +611,8 @@ write_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
fru->max_write_size); fru->max_write_size);
continue; continue;
} }
} else if (rsp->ccode == 0x80) { } else if (rsp->ccode == IPMI_CC_FRU_WRITE_PROTECTED_OFFSET) {
rsp->ccode = 0; rsp->ccode = IPMI_CC_OK;
// Write protected section // Write protected section
protected_bloc = 1; protected_bloc = 1;
} }
@ -4014,7 +4014,7 @@ ipmi_fru_get_multirec_location_from_fru(struct ipmi_intf * intf,
} }
if (rsp->ccode) { if (rsp->ccode) {
if (rsp->ccode == 0xc3) if (rsp->ccode == IPMI_CC_TIMEOUT)
printf (" Timeout accessing FRU info. (Device not present?)\n"); printf (" Timeout accessing FRU info. (Device not present?)\n");
else else
printf (" CCODE = 0x%02x\n", rsp->ccode); printf (" CCODE = 0x%02x\n", rsp->ccode);
@ -4046,7 +4046,7 @@ ipmi_fru_get_multirec_location_from_fru(struct ipmi_intf * intf,
if (!rsp) if (!rsp)
return -1; return -1;
if (rsp->ccode) { if (rsp->ccode) {
if (rsp->ccode == 0xc3) if (rsp->ccode == IPMI_CC_TIMEOUT)
printf (" Timeout while reading FRU data. (Device not present?)\n"); printf (" Timeout while reading FRU data. (Device not present?)\n");
return -1; return -1;
} }