mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
ID: 50 - ipmi_hpmfwupg needs a clean up
HpmfwupgGetComponentProperties() - kill indent by rewriting two if() conditions.
This commit is contained in:
parent
5d3c64f028
commit
b803224398
@ -1678,8 +1678,20 @@ HpmfwupgGetComponentProperties(struct ipmi_intf *intf,
|
|||||||
req.msg.data = (unsigned char*)&pCtx->req;
|
req.msg.data = (unsigned char*)&pCtx->req;
|
||||||
req.msg.data_len = sizeof(struct HpmfwupgGetComponentPropertiesReq);
|
req.msg.data_len = sizeof(struct HpmfwupgGetComponentPropertiesReq);
|
||||||
rsp = HpmfwupgSendCmd(intf, req, NULL);
|
rsp = HpmfwupgSendCmd(intf, req, NULL);
|
||||||
if (rsp) {
|
if (rsp == NULL) {
|
||||||
if (rsp->ccode == 0x00) {
|
lprintf(LOG_NOTICE,
|
||||||
|
"Error getting component properties\n");
|
||||||
|
return HPMFWUPG_ERROR;
|
||||||
|
}
|
||||||
|
if (rsp->ccode != 0x00) {
|
||||||
|
lprintf(LOG_NOTICE,
|
||||||
|
"Error getting component properties");
|
||||||
|
lprintf(LOG_NOTICE,
|
||||||
|
"compcode=0x%x: %s",
|
||||||
|
rsp->ccode,
|
||||||
|
val2str(rsp->ccode, completion_code_vals));
|
||||||
|
return HPMFWUPG_ERROR;
|
||||||
|
}
|
||||||
switch (pCtx->req.selector) {
|
switch (pCtx->req.selector) {
|
||||||
case HPMFWUPG_COMP_GEN_PROPERTIES:
|
case HPMFWUPG_COMP_GEN_PROPERTIES:
|
||||||
memcpy(&pCtx->resp, rsp->data, sizeof(struct HpmfwupgGetGeneralPropResp));
|
memcpy(&pCtx->resp, rsp->data, sizeof(struct HpmfwupgGetGeneralPropResp));
|
||||||
@ -1758,8 +1770,8 @@ HpmfwupgGetComponentProperties(struct ipmi_intf *intf,
|
|||||||
pCtx->resp.Response.deferredFwVersionResp.deferredFwVersion[5]);
|
pCtx->resp.Response.deferredFwVersionResp.deferredFwVersion[5]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
/* OEM Properties command */
|
|
||||||
case HPMFWUPG_COMP_OEM_PROPERTIES:
|
case HPMFWUPG_COMP_OEM_PROPERTIES:
|
||||||
|
/* OEM Properties command */
|
||||||
memcpy(&pCtx->resp, rsp->data, sizeof(struct HpmfwupgGetOemProperties));
|
memcpy(&pCtx->resp, rsp->data, sizeof(struct HpmfwupgGetOemProperties));
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
unsigned char i = 0;
|
unsigned char i = 0;
|
||||||
@ -1775,20 +1787,6 @@ HpmfwupgGetComponentProperties(struct ipmi_intf *intf,
|
|||||||
rc = HPMFWUPG_ERROR;
|
rc = HPMFWUPG_ERROR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
lprintf(LOG_NOTICE,
|
|
||||||
"Error getting component properties");
|
|
||||||
lprintf(LOG_NOTICE,
|
|
||||||
"compcode=0x%x: %s",
|
|
||||||
rsp->ccode,
|
|
||||||
val2str(rsp->ccode, completion_code_vals));
|
|
||||||
rc = HPMFWUPG_ERROR;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
lprintf(LOG_NOTICE,
|
|
||||||
"Error getting component properties\n");
|
|
||||||
rc = HPMFWUPG_ERROR;
|
|
||||||
}
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user