[lkml]   [2016]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: [PATCH] Kbuild: provide a __UNIQUE_ID for clang
On Monday 08 February 2016 19:13:26 Michal Marek wrote:
> On Mon, Feb 08, 2016 at 03:38:32PM +0100, Arnd Bergmann wrote:
> > The default __UNIQUE_ID macro in compiler.h fails to work for some drivers:
> >
> > drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:615:1: error: redefinition of
> > '__UNIQUE_ID_firmware615'
> > BRCMF_FW_NVRAM_DEF(4354, "brcmfmac4354-sdio.bin", "brcmfmac4354-sdio.txt");
> I applied the patch to kbuild.git#kbuild, but can you tell me with which
> commit and config you get such failure. I only see a single
> MODULE_FIRMWARE() call in the expansion of BRCMF_FW_NVRAM_DEF(), which
> should work with line numbers as well. And I can't reproduce it with
> today's linux-next. If there is some issue with code not yet in
> linux-next, it needs to be worked around, because older GCCs did not
> have __COUNTER__.

I wrote this patch in early January before Arend van Spriel changed the
code with the patch below. I wasn't aware of his change, but that explains
why you don't see the problem any more.


commit 23195ec00503c6c29daea5b6c780787c0b5f1bf3
Author: Arend van Spriel <>
Date: Sat Jan 16 16:39:13 2016 +0100

brcmfmac: fix BRCMF_FW_NVRAM_DEF macro for older gcc compilers

With gcc < 4.3 __UNIQUE_ID does not create unique ids with the macro
BRCMF_FW_NVRAM_DEF. Fix this by removing the MODULE_FIRMWARE instance
for the nvram file. This file is not in linux-firmware repo so it may
not be needed anyway. Otherwise consider this as a temporary fix.

Reported-by: Geert Uytterhoeven <>
Signed-off-by: Arend van Spriel <>
Acked-by: Kalle Valo <>
Tested-by: Geert Uytterhoeven <>
Signed-off-by: David S. Miller <>

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h
index ef06f57a7a0e..d3c9f0d52ae3 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h
@@ -47,8 +47,7 @@ static const char BRCM_ ## fw_nvram_name ## _FIRMWARE_NAME[] = \
static const char BRCM_ ## fw_nvram_name ## _NVRAM_NAME[] = \

#define BRCMF_FW_DEF(fw_name, fw) \
static const char BRCM_ ## fw_name ## _FIRMWARE_NAME[] = \
 \ /
  Last update: 2016-02-09 16:01    [W:0.056 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site