]> git.ipfire.org Git - thirdparty/linux.git/commit
wifi: brcmfmac: avoid assignment in if/else-if conditions in NVRAM load path
authorDarshan Rathod <darshanrathod475@gmail.com>
Tue, 12 Aug 2025 12:36:36 +0000 (18:06 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 3 Sep 2025 08:02:09 +0000 (10:02 +0200)
commitb662bc503d95058b1cd640941edc48588849d9ce
treece17917a675768df304520ffd94181f688c28bf5
parent1373f94148a5adac2f42c8ba9771105624fe4af0
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>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c