ID: 50 - ipmi_hpmfwupg needs a clean up

HpmfwupgUploadFirmwareBlock() - kill a bit of indent by re-writing one if().
This commit is contained in:
Zdenek Styblik 2013-10-10 11:42:32 +00:00
parent 18aadc30d0
commit 6de0796079

View File

@ -1867,7 +1867,10 @@ HpmfwupgUploadFirmwareBlock(struct ipmi_intf *intf,
/* 2 is the size of the upload struct - data */
req.msg.data_len = 2 + count;
rsp = HpmfwupgSendCmd(intf, req, pFwupgCtx);
if (rsp) {
if (rsp == NULL) {
lprintf(LOG_NOTICE, "Error uploading firmware block.");
return HPMFWUPG_ERROR;
}
if (rsp->ccode == HPMFWUPG_COMMAND_IN_PROGRESS
|| rsp->ccode == 0x00) {
/*
@ -1906,27 +1909,23 @@ HpmfwupgUploadFirmwareBlock(struct ipmi_intf *intf,
* check will have to be removed. (Buggy version = 39)
*/
if (HPMFWUPG_IS_RETRYABLE(rsp->ccode)) {
lprintf(LOG_DEBUG,"HPM: [PATCH]Retryable error detected");
lprintf(LOG_DEBUG, "HPM: [PATCH]Retryable error detected");
rc = HPMFWUPG_UPLOAD_RETRY;
} else if ( rsp->ccode == IPMI_CC_REQ_DATA_INV_LENGTH ||
} else if (rsp->ccode == IPMI_CC_REQ_DATA_INV_LENGTH ||
rsp->ccode == IPMI_CC_REQ_DATA_FIELD_EXCEED) {
/* If completion code = 0xc7(0xc8), we will retry with a reduced buffer length.
* Do not print error.
*/
rc = HPMFWUPG_UPLOAD_BLOCK_LENGTH;
} else {
lprintf(LOG_NOTICE,"Error uploading firmware block");
lprintf(LOG_NOTICE,"compcode=0x%x: %s",
lprintf(LOG_ERR, "Error uploading firmware block");
lprintf(LOG_ERR, "compcode=0x%x: %s",
rsp->ccode,
val2str(rsp->ccode,
completion_code_vals));
rc = HPMFWUPG_ERROR;
}
}
} else {
lprintf(LOG_NOTICE, "Error uploading firmware block\n");
rc = HPMFWUPG_ERROR;
}
return rc;
}