Remove the goto statement from FillH2CCmd_88E(). In this function goto
can be replace by return statement. As on goto label exit, function
only return it is not performing any cleanup. Avoiding goto will
improve the function readability. After replacing the goto statement
local variable ret is also not needed. So remove the ret local variable.
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YXjXsChOpaTThkxT@Sauravs-Air.domain.name
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
u8 cmd_idx, ext_cmd_len;
u32 h2c_cmd = 0;
u32 h2c_cmd_ex = 0;
- s32 ret = _FAIL;
if (!adapt->bFWReady) {
DBG_88E("FillH2CCmd_88E(): return H2C cmd because fw is not ready\n");
- return ret;
+ return _FAIL;
}
- if (!pCmdBuffer)
- goto exit;
- if (CmdLen > RTL88E_MAX_CMD_LEN)
- goto exit;
- if (adapt->bSurpriseRemoved)
- goto exit;
+ if (!pCmdBuffer || CmdLen > RTL88E_MAX_CMD_LEN || adapt->bSurpriseRemoved)
+ return _FAIL;
/* pay attention to if race condition happened in H2C cmd setting. */
do {
if (!_is_fw_read_cmd_down(adapt, h2c_box_num)) {
DBG_88E(" fw read cmd failed...\n");
- goto exit;
+ return _FAIL;
}
*(u8 *)(&h2c_cmd) = ElementID;
} while ((!bcmd_down) && (retry_cnts--));
- ret = _SUCCESS;
-
-exit:
-
- return ret;
+ return _SUCCESS;
}
u8 rtl8188e_set_raid_cmd(struct adapter *adapt, u32 mask)