sfxge(4): simplify verify result handling

Simplify verify result handling in NVRAM update finish

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18085
This commit is contained in:
Andrew Rybchenko 2018-11-23 10:20:08 +00:00
parent c703323657
commit f0d3455bf8

View File

@ -949,24 +949,23 @@ efx_mcdi_nvram_update_finish(
goto fail1;
}
if (encp->enc_fw_verified_nvram_update_required == B_FALSE) {
/* Report success if verified updates are not supported. */
result = MC_CMD_NVRAM_VERIFY_RC_SUCCESS;
} else {
/* Firmware-verified NVRAM updates are required */
if (req.emr_out_length_used <
MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN) {
if (req.emr_out_length_used < MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN) {
result = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN;
if (encp->enc_fw_verified_nvram_update_required) {
/* Mandatory verification result is missing */
rc = EMSGSIZE;
goto fail2;
}
} else {
result =
MCDI_OUT_DWORD(req, NVRAM_UPDATE_FINISH_V2_OUT_RESULT_CODE);
}
if (result != MC_CMD_NVRAM_VERIFY_RC_SUCCESS) {
/* Mandatory verification failed */
rc = EINVAL;
goto fail3;
}
if ((encp->enc_fw_verified_nvram_update_required) &&
(result != MC_CMD_NVRAM_VERIFY_RC_SUCCESS)) {
/* Mandatory verification failed */
rc = EINVAL;
goto fail3;
}
if (resultp != NULL)