5d454fd3eed7c464c8136907f7ef050860ced1a1
[oweals/openwrt.git] /
1 From 412dd15c8177d93abe0c8787b83b31c5eb061405 Mon Sep 17 00:00:00 2001
2 From: Arnd Bergmann <arnd@arndb.de>
3 Date: Mon, 10 Dec 2018 21:55:37 +0100
4 Subject: [PATCH] brcmfmac: fix false-positive -Wmaybe-unintialized warning
5
6 When CONFIG_NO_AUTO_INLINE is set, we get a false-postive warning
7 for the brcmf_fw_request_nvram_done() function, after gcc figures
8 out that brcmf_fw_nvram_from_efi() might not set the 'data_len'
9 variable, but fails to notice that it always returns NULL:
10
11 drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c: In function 'brcmf_fw_request_nvram_done':
12 drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:560:11: error: 'data_len' may be used uninitialized in this function [-Werror=maybe-uninitialized]
13
14 Mark it 'inline' to force gcc to understand this.
15
16 Fixes: ce2e6db554fa ("brcmfmac: Add support for getting nvram contents from EFI variables")
17 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
18 Reviewed-by: Hans de Goede <hdegoede@redhat.com>
19 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
20 ---
21  drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 2 +-
22  1 file changed, 1 insertion(+), 1 deletion(-)
23
24 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
25 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
26 @@ -512,7 +512,7 @@ fail:
27         return NULL;
28  }
29  #else
30 -static u8 *brcmf_fw_nvram_from_efi(size_t *data_len) { return NULL; }
31 +static inline u8 *brcmf_fw_nvram_from_efi(size_t *data_len) { return NULL; }
32  #endif
33  
34  static void brcmf_fw_free_request(struct brcmf_fw_request *req)