* [PATCH] brcmfmac: fix false-positive -Wmaybe-unintialized warning
@ 2018-12-10 20:55 Arnd Bergmann
2018-12-11 13:04 ` Hans de Goede
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Arnd Bergmann @ 2018-12-10 20:55 UTC (permalink / raw)
To: Arend van Spriel, Franky Lin, Hante Meuleman, Chi-Hsien Lin, Wright Feng
Cc: Arnd Bergmann, Kalle Valo, David S. Miller, Hans de Goede,
Pieter-Paul Giesberts, Lyude Paul, linux-wireless,
brcm80211-dev-list.pdl, brcm80211-dev-list, netdev, linux-kernel
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.
Fixes: ce2e6db554fa ("brcmfmac: Add support for getting nvram contents from EFI variables")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
index dad3c1c79038..14b948917a1a 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
@@ -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)
--
2.20.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] brcmfmac: fix false-positive -Wmaybe-unintialized warning
2018-12-10 20:55 [PATCH] brcmfmac: fix false-positive -Wmaybe-unintialized warning Arnd Bergmann
@ 2018-12-11 13:04 ` Hans de Goede
2018-12-13 14:52 ` Kalle Valo
2018-12-13 14:59 ` Kalle Valo
2 siblings, 0 replies; 4+ messages in thread
From: Hans de Goede @ 2018-12-11 13:04 UTC (permalink / raw)
To: Arnd Bergmann, Arend van Spriel, Franky Lin, Hante Meuleman,
Chi-Hsien Lin, Wright Feng
Cc: Kalle Valo, David S. Miller, Pieter-Paul Giesberts, Lyude Paul,
linux-wireless, brcm80211-dev-list.pdl, brcm80211-dev-list,
netdev, linux-kernel
Hi,
On 10-12-18 21:55, Arnd Bergmann wrote:
> 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.
>
> Fixes: ce2e6db554fa ("brcmfmac: Add support for getting nvram contents from EFI variables")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Regards,
Hans
> ---
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
> index dad3c1c79038..14b948917a1a 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
> @@ -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)
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] brcmfmac: fix false-positive -Wmaybe-unintialized warning
2018-12-10 20:55 [PATCH] brcmfmac: fix false-positive -Wmaybe-unintialized warning Arnd Bergmann
2018-12-11 13:04 ` Hans de Goede
@ 2018-12-13 14:52 ` Kalle Valo
2018-12-13 14:59 ` Kalle Valo
2 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2018-12-13 14:52 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Arend van Spriel, Franky Lin, Hante Meuleman, Chi-Hsien Lin,
Wright Feng, Arnd Bergmann, David S. Miller, Hans de Goede,
Pieter-Paul Giesberts, Lyude Paul, linux-wireless,
brcm80211-dev-list.pdl, brcm80211-dev-list, netdev, linux-kernel
Arnd Bergmann <arnd@arndb.de> wrote:
> 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.
>
> Fixes: ce2e6db554fa ("brcmfmac: Add support for getting nvram contents from EFI variables")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Commit ce2e6db554fa is in w-d-next so this should go to that tree as well.
--
https://patchwork.kernel.org/patch/10722445/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] brcmfmac: fix false-positive -Wmaybe-unintialized warning
2018-12-10 20:55 [PATCH] brcmfmac: fix false-positive -Wmaybe-unintialized warning Arnd Bergmann
2018-12-11 13:04 ` Hans de Goede
2018-12-13 14:52 ` Kalle Valo
@ 2018-12-13 14:59 ` Kalle Valo
2 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2018-12-13 14:59 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Arend van Spriel, Franky Lin, Hante Meuleman, Chi-Hsien Lin,
Wright Feng, Arnd Bergmann, David S. Miller, Hans de Goede,
Pieter-Paul Giesberts, Lyude Paul, linux-wireless,
brcm80211-dev-list.pdl, brcm80211-dev-list, netdev, linux-kernel
Arnd Bergmann <arnd@arndb.de> wrote:
> 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.
>
> Fixes: ce2e6db554fa ("brcmfmac: Add support for getting nvram contents from EFI variables")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Patch applied to wireless-drivers-next.git, thanks.
412dd15c8177 brcmfmac: fix false-positive -Wmaybe-unintialized warning
--
https://patchwork.kernel.org/patch/10722445/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-12-13 14:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-10 20:55 [PATCH] brcmfmac: fix false-positive -Wmaybe-unintialized warning Arnd Bergmann
2018-12-11 13:04 ` Hans de Goede
2018-12-13 14:52 ` Kalle Valo
2018-12-13 14:59 ` Kalle Valo
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.