mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 00:53:34 +02:00
wifi: brcmfmac: avoid assignment in if/else-if conditions in NVRAM load path
The NVRAM selection logic in brcmf_fw_request_nvram_done() used
patterns like:
if ((data = bcm47xx_nvram_get_contents(&data_len)))
free_bcm47xx_nvram = true;
else if ((data = brcmf_fw_nvram_from_efi(&data_len)))
kfree_nvram = true;
This style violates kernel coding style guidelines and triggers
checkpatch.pl errors. It also slightly reduces readability.
Refactor these cases by separating the assignment and the check,
ensuring behavior remains identical while complying with coding
standards.
Signed-off-by: Darshan Rathod <darshanrathod475@gmail.com>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Link: https://patch.msgid.link/20250812123636.2142292-1-darshanrathod475@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
1373f94148
commit
b662bc503d
|
|
@ -554,12 +554,16 @@ static int brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx)
|
|||
data = (u8 *)fw->data;
|
||||
data_len = fw->size;
|
||||
} else {
|
||||
if ((data = bcm47xx_nvram_get_contents(&data_len)))
|
||||
data = bcm47xx_nvram_get_contents(&data_len);
|
||||
if (data) {
|
||||
free_bcm47xx_nvram = true;
|
||||
else if ((data = brcmf_fw_nvram_from_efi(&data_len)))
|
||||
kfree_nvram = true;
|
||||
else if (!(cur->flags & BRCMF_FW_REQF_OPTIONAL))
|
||||
goto fail;
|
||||
} else {
|
||||
data = brcmf_fw_nvram_from_efi(&data_len);
|
||||
if (data)
|
||||
kfree_nvram = true;
|
||||
else if (!(cur->flags & BRCMF_FW_REQF_OPTIONAL))
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
if (data)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user