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
HpmfwupgUploadFirmwareBlock() - kill a bit of indent by re-writing one if().
This commit is contained in:
parent
18aadc30d0
commit
6de0796079
@ -1867,7 +1867,10 @@ HpmfwupgUploadFirmwareBlock(struct ipmi_intf *intf,
|
|||||||
/* 2 is the size of the upload struct - data */
|
/* 2 is the size of the upload struct - data */
|
||||||
req.msg.data_len = 2 + count;
|
req.msg.data_len = 2 + count;
|
||||||
rsp = HpmfwupgSendCmd(intf, req, pFwupgCtx);
|
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
|
if (rsp->ccode == HPMFWUPG_COMMAND_IN_PROGRESS
|
||||||
|| rsp->ccode == 0x00) {
|
|| rsp->ccode == 0x00) {
|
||||||
/*
|
/*
|
||||||
@ -1906,27 +1909,23 @@ HpmfwupgUploadFirmwareBlock(struct ipmi_intf *intf,
|
|||||||
* check will have to be removed. (Buggy version = 39)
|
* check will have to be removed. (Buggy version = 39)
|
||||||
*/
|
*/
|
||||||
if (HPMFWUPG_IS_RETRYABLE(rsp->ccode)) {
|
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;
|
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) {
|
rsp->ccode == IPMI_CC_REQ_DATA_FIELD_EXCEED) {
|
||||||
/* If completion code = 0xc7(0xc8), we will retry with a reduced buffer length.
|
/* If completion code = 0xc7(0xc8), we will retry with a reduced buffer length.
|
||||||
* Do not print error.
|
* Do not print error.
|
||||||
*/
|
*/
|
||||||
rc = HPMFWUPG_UPLOAD_BLOCK_LENGTH;
|
rc = HPMFWUPG_UPLOAD_BLOCK_LENGTH;
|
||||||
} else {
|
} else {
|
||||||
lprintf(LOG_NOTICE,"Error uploading firmware block");
|
lprintf(LOG_ERR, "Error uploading firmware block");
|
||||||
lprintf(LOG_NOTICE,"compcode=0x%x: %s",
|
lprintf(LOG_ERR, "compcode=0x%x: %s",
|
||||||
rsp->ccode,
|
rsp->ccode,
|
||||||
val2str(rsp->ccode,
|
val2str(rsp->ccode,
|
||||||
completion_code_vals));
|
completion_code_vals));
|
||||||
rc = HPMFWUPG_ERROR;
|
rc = HPMFWUPG_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
lprintf(LOG_NOTICE, "Error uploading firmware block\n");
|
|
||||||
rc = HPMFWUPG_ERROR;
|
|
||||||
}
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user