summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2018-12-28 07:31:16 -0800
committerAlexander Amelkin <mocbuhtig@amelkin.msk.ru>2019-02-13 21:28:14 +0300
commitbe3d57c013bcfe2d9d0be851f6cf1571de8f33a0 (patch)
treed93fed1d90cd4de93770faf2c02b849632949e7c
parentf64044a3de9e563d3454170e94f025486437cddd (diff)
downloadipmitool-be3d57c013bcfe2d9d0be851f6cf1571de8f33a0.tar.gz
fru: replace magic return codes with macros
Use the return code macros instead of magic numbers. Signed-off-by: Patrick Venture <venture@google.com>
-rw-r--r--lib/ipmi_fru.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ipmi_fru.c b/lib/ipmi_fru.c
index 4ba460e..f2f4cec 100644
--- a/lib/ipmi_fru.c
+++ b/lib/ipmi_fru.c
@@ -611,8 +611,8 @@ write_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
fru->max_write_size);
continue;
}
- } else if (rsp->ccode == 0x80) {
- rsp->ccode = 0;
+ } else if (rsp->ccode == IPMI_CC_FRU_WRITE_PROTECTED_OFFSET) {
+ rsp->ccode = IPMI_CC_OK;
// Write protected section
protected_bloc = 1;
}
@@ -4014,7 +4014,7 @@ ipmi_fru_get_multirec_location_from_fru(struct ipmi_intf * intf,
}
if (rsp->ccode) {
- if (rsp->ccode == 0xc3)
+ if (rsp->ccode == IPMI_CC_TIMEOUT)
printf (" Timeout accessing FRU info. (Device not present?)\n");
else
printf (" CCODE = 0x%02x\n", rsp->ccode);
@@ -4046,7 +4046,7 @@ ipmi_fru_get_multirec_location_from_fru(struct ipmi_intf * intf,
if (!rsp)
return -1;
if (rsp->ccode) {
- if (rsp->ccode == 0xc3)
+ if (rsp->ccode == IPMI_CC_TIMEOUT)
printf (" Timeout while reading FRU data. (Device not present?)\n");
return -1;
}