ID: 50 - ipmi_hpmfwupg needs a clean up

HpmfwupgGetComponentProperties() - kill indent by rewriting two if() conditions.
This commit is contained in:
Zdenek Styblik 2013-10-10 11:23:35 +00:00
parent 5d3c64f028
commit b803224398

View File

@ -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;
} }