提交 412dd15c 编写于 作者: A Arnd Bergmann 提交者: Kalle Valo

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.

Fixes: ce2e6db5 ("brcmfmac: Add support for getting nvram contents from EFI variables")
Signed-off-by: NArnd Bergmann <arnd@arndb.de>
Reviewed-by: NHans de Goede <hdegoede@redhat.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 29f65891
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册