brcmfmac: fix false-positive -Wmaybe-unintialized warning
PATCH 1/1 brcmfmac: fix false-positive -Wmaybe-unintialized warning
When CONFIG_NO_AUTO_INLINE is set, we get a false-postive warning for the brcmf_fw_request_nvram_done() function, after gcc figures out that brcmf_fw_nvram_from_efi() might not set the 'data_len' variable, but fails to notice that it always returns NULL:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c: In function 'brcmf_fw_request_nvram_done':drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:560:11: error: 'data_len' may be used uninitialized in this function [-Werror=maybe-uninitialized]
Mark it 'inline' to force gcc to understand this.
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +1 -1
@@ -512,7 +512,7 @@ static u8 *brcmf_fw_nvram_from_efi(size_t *data_len_ret) return NULL; }#else -static u8 *brcmf_fw_nvram_from_efi (size_t *data_len) {return NULL ; } +static inline u8 *brcmf_fw_nvram_from_efi (size_t *data_len) {return NULL ; }#endif static void brcmf_fw_free_request (struct brcmf_fw_request *req)
Signature · 1 line
2.20.0
Hi,
Quoted 5 lines · Arnd Bergmann
When
CONFIG_NO_AUTO_INLINEis set, we get a false-postive warning for thebrcmf_fw_request_nvram_done()function, after gcc figures out thatbrcmf_fw_nvram_from_efi()might not set the 'data_len' variable, but fails to notice that it always returns NULL:
Quoted 7 lines
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c: In function 'brcmf_fw_request_nvram_done':drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:560:11: error: 'data_len' may be used uninitialized in this function [-Werror=maybe-uninitialized]Mark it 'inline' to force gcc to understand this.
Fixes ce2e6db554fa ("brcmfmac: Add support for getting nvram contents from EFI variables")Signed-off-by Arnd Bergmann <[email protected]>
Thanks, patch looks good to me:
Regards,
Hans
Quoted 18 lines
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +1
-1@@ -512,7 +512,7 @@ static u8 *brcmf_fw_nvram_from_efi(size_t *data_len_ret) return NULL; }#else -static u8 *brcmf_fw_nvram_from_efi (size_t *data_len) {return NULL ; } +static inline u8 *brcmf_fw_nvram_from_efi (size_t *data_len) {return NULL ; }#endif static void brcmf_fw_free_request (struct brcmf_fw_request *req)
Quoted 5 lines · Arnd Bergmann
When
CONFIG_NO_AUTO_INLINEis set, we get a false-postive warning for thebrcmf_fw_request_nvram_done()function, after gcc figures out thatbrcmf_fw_nvram_from_efi()might not set the 'data_len' variable, but fails to notice that it always returns NULL:
Quoted 8 lines
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c: In function 'brcmf_fw_request_nvram_done':drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:560:11: error: 'data_len' may be used uninitialized in this function [-Werror=maybe-uninitialized]Mark it 'inline' to force gcc to understand this.
Fixes ce2e6db554fa ("brcmfmac: Add support for getting nvram contents from EFI variables")Signed-off-by Arnd Bergmann <[email protected]>Reviewed-by Hans de Goede <[email protected]>
Commit ce2e6db554fa is in w-d-next so this should go to that tree as well.
Signature · 3 lines
https://patchwork.kernel.org/patch/10722445/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 5 lines · Arnd Bergmann
When
CONFIG_NO_AUTO_INLINEis set, we get a false-postive warning for thebrcmf_fw_request_nvram_done()function, after gcc figures out thatbrcmf_fw_nvram_from_efi()might not set the 'data_len' variable, but fails to notice that it always returns NULL:
Quoted 8 lines
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c: In function 'brcmf_fw_request_nvram_done':drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:560:11: error: 'data_len' may be used uninitialized in this function [-Werror=maybe-uninitialized]Mark it 'inline' to force gcc to understand this.
Fixes ce2e6db554fa ("brcmfmac: Add support for getting nvram contents from EFI variables")Signed-off-by Arnd Bergmann <[email protected]>Reviewed-by Hans de Goede <[email protected]>
Patch applied to wireless-drivers-next.git, thanks.
412dd15c8177 brcmfmac: fix false-positive -Wmaybe-unintialized warning
Signature · 3 lines
https://patchwork.kernel.org/patch/10722445/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches