mirror of
https://github.com/ipmitool/ipmitool.git
synced 2026-01-22 22:52:20 +08:00
ID: 50 - ipmi_hpmfwupg needs a clean up
HpmfwupgGetTargetUpgCapabilities() - remove unnecessary if() and kill indent.
This commit is contained in:
parent
942dcb71d8
commit
5d3c64f028
@ -1592,7 +1592,6 @@ int
|
|||||||
HpmfwupgGetTargetUpgCapabilities(struct ipmi_intf *intf,
|
HpmfwupgGetTargetUpgCapabilities(struct ipmi_intf *intf,
|
||||||
struct HpmfwupgGetTargetUpgCapabilitiesCtx *pCtx)
|
struct HpmfwupgGetTargetUpgCapabilitiesCtx *pCtx)
|
||||||
{
|
{
|
||||||
int rc = HPMFWUPG_SUCCESS;
|
|
||||||
struct ipmi_rs *rsp;
|
struct ipmi_rs *rsp;
|
||||||
struct ipmi_rq req;
|
struct ipmi_rq req;
|
||||||
pCtx->req.picmgId = HPMFWUPG_PICMG_IDENTIFIER;
|
pCtx->req.picmgId = HPMFWUPG_PICMG_IDENTIFIER;
|
||||||
@ -1602,8 +1601,18 @@ HpmfwupgGetTargetUpgCapabilities(struct ipmi_intf *intf,
|
|||||||
req.msg.data = (unsigned char*)&pCtx->req;
|
req.msg.data = (unsigned char*)&pCtx->req;
|
||||||
req.msg.data_len = sizeof(struct HpmfwupgGetTargetUpgCapabilitiesReq);
|
req.msg.data_len = sizeof(struct HpmfwupgGetTargetUpgCapabilitiesReq);
|
||||||
rsp = HpmfwupgSendCmd(intf, req, NULL);
|
rsp = HpmfwupgSendCmd(intf, req, NULL);
|
||||||
if (rsp) {
|
if (rsp == NULL) {
|
||||||
if (rsp->ccode == 0x00) {
|
lprintf(LOG_ERR,
|
||||||
|
"Error getting target upgrade capabilities.");
|
||||||
|
return HPMFWUPG_ERROR;
|
||||||
|
}
|
||||||
|
if (rsp->ccode != 0x00) {
|
||||||
|
lprintf(LOG_ERR,
|
||||||
|
"Error getting target upgrade capabilities, ccode: 0x%x: %s",
|
||||||
|
rsp->ccode,
|
||||||
|
val2str(rsp->ccode, completion_code_vals));
|
||||||
|
return HPMFWUPG_ERROR;
|
||||||
|
}
|
||||||
memcpy(&pCtx->resp, rsp->data,
|
memcpy(&pCtx->resp, rsp->data,
|
||||||
sizeof(struct HpmfwupgGetTargetUpgCapabilitiesResp));
|
sizeof(struct HpmfwupgGetTargetUpgCapabilitiesResp));
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
@ -1652,18 +1661,7 @@ HpmfwupgGetTargetUpgCapabilities(struct ipmi_intf *intf,
|
|||||||
lprintf(LOG_NOTICE, "Inaccessibility timeout.[%d sec] \n",
|
lprintf(LOG_NOTICE, "Inaccessibility timeout.[%d sec] \n",
|
||||||
pCtx->resp.inaccessTimeout*5);
|
pCtx->resp.inaccessTimeout*5);
|
||||||
}
|
}
|
||||||
} else {
|
return HPMFWUPG_SUCCESS;
|
||||||
lprintf(LOG_NOTICE,
|
|
||||||
"Error getting target upgrade capabilities\n",
|
|
||||||
rsp->ccode);
|
|
||||||
rc = HPMFWUPG_ERROR;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
lprintf(LOG_NOTICE,
|
|
||||||
"Error getting target upgrade capabilities\n");
|
|
||||||
rc = HPMFWUPG_ERROR;
|
|
||||||
}
|
|
||||||
return rc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user