* [PATCH] Kbuild: provide a __UNIQUE_ID for clang
@ 2016-02-08 14:38 ` Arnd Bergmann
0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2016-02-08 14:38 UTC (permalink / raw)
To: Michal Marek
Cc: linux-arm-kernel, Arnd Bergmann, Mark Charlebois, Behan Webster,
linux-kernel
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");
This adds a copy of the version we use for gcc-4.3 and higher, as the same
one works with all versions of clang that I could find in svn (2.6 and higher).
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
include/linux/compiler-clang.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
index d1e49d52b640..de179993e039 100644
--- a/include/linux/compiler-clang.h
+++ b/include/linux/compiler-clang.h
@@ -10,3 +10,8 @@
#undef uninitialized_var
#define uninitialized_var(x) x = *(&(x))
#endif
+
+/* same as gcc, this was present in clang-2.6 so we can assume it works
+ * with any version that can compile the kernel
+ */
+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
--
2.7.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] Kbuild: provide a __UNIQUE_ID for clang
@ 2016-02-08 14:38 ` Arnd Bergmann
0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2016-02-08 14:38 UTC (permalink / raw)
To: linux-arm-kernel
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");
This adds a copy of the version we use for gcc-4.3 and higher, as the same
one works with all versions of clang that I could find in svn (2.6 and higher).
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
include/linux/compiler-clang.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
index d1e49d52b640..de179993e039 100644
--- a/include/linux/compiler-clang.h
+++ b/include/linux/compiler-clang.h
@@ -10,3 +10,8 @@
#undef uninitialized_var
#define uninitialized_var(x) x = *(&(x))
#endif
+
+/* same as gcc, this was present in clang-2.6 so we can assume it works
+ * with any version that can compile the kernel
+ */
+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
--
2.7.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] Kbuild: provide a __UNIQUE_ID for clang
2016-02-08 14:38 ` Arnd Bergmann
@ 2016-02-08 18:13 ` Michal Marek
-1 siblings, 0 replies; 6+ messages in thread
From: Michal Marek @ 2016-02-08 18:13 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Michal Marek, linux-arm-kernel, Mark Charlebois, Behan Webster,
linux-kernel
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__.
Michal
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] Kbuild: provide a __UNIQUE_ID for clang
@ 2016-02-08 18:13 ` Michal Marek
0 siblings, 0 replies; 6+ messages in thread
From: Michal Marek @ 2016-02-08 18:13 UTC (permalink / raw)
To: linux-arm-kernel
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__.
Michal
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Kbuild: provide a __UNIQUE_ID for clang
2016-02-08 18:13 ` Michal Marek
@ 2016-02-09 14:54 ` Arnd Bergmann
-1 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2016-02-09 14:54 UTC (permalink / raw)
To: Michal Marek
Cc: Michal Marek, linux-arm-kernel, Mark Charlebois, Behan Webster,
linux-kernel
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.
Arnd
commit 23195ec00503c6c29daea5b6c780787c0b5f1bf3
Author: Arend van Spriel <aspriel@gmail.com>
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 <geert@linux-m68k.org>
Signed-off-by: Arend van Spriel <aspriel@gmail.com>
Acked-by: Kalle Valo <kvalo@codeaurora.org>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
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[] = \
BRCMF_FW_DEFAULT_PATH fw; \
static const char BRCM_ ## fw_nvram_name ## _NVRAM_NAME[] = \
BRCMF_FW_DEFAULT_PATH nvram; \
-MODULE_FIRMWARE(BRCMF_FW_DEFAULT_PATH fw); \
-MODULE_FIRMWARE(BRCMF_FW_DEFAULT_PATH nvram)
+MODULE_FIRMWARE(BRCMF_FW_DEFAULT_PATH fw);
#define BRCMF_FW_DEF(fw_name, fw) \
static const char BRCM_ ## fw_name ## _FIRMWARE_NAME[] = \
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] Kbuild: provide a __UNIQUE_ID for clang
@ 2016-02-09 14:54 ` Arnd Bergmann
0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2016-02-09 14:54 UTC (permalink / raw)
To: linux-arm-kernel
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.
Arnd
commit 23195ec00503c6c29daea5b6c780787c0b5f1bf3
Author: Arend van Spriel <aspriel@gmail.com>
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 <geert@linux-m68k.org>
Signed-off-by: Arend van Spriel <aspriel@gmail.com>
Acked-by: Kalle Valo <kvalo@codeaurora.org>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
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[] = \
BRCMF_FW_DEFAULT_PATH fw; \
static const char BRCM_ ## fw_nvram_name ## _NVRAM_NAME[] = \
BRCMF_FW_DEFAULT_PATH nvram; \
-MODULE_FIRMWARE(BRCMF_FW_DEFAULT_PATH fw); \
-MODULE_FIRMWARE(BRCMF_FW_DEFAULT_PATH nvram)
+MODULE_FIRMWARE(BRCMF_FW_DEFAULT_PATH fw);
#define BRCMF_FW_DEF(fw_name, fw) \
static const char BRCM_ ## fw_name ## _FIRMWARE_NAME[] = \
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-02-09 14:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-08 14:38 [PATCH] Kbuild: provide a __UNIQUE_ID for clang Arnd Bergmann
2016-02-08 14:38 ` Arnd Bergmann
2016-02-08 18:13 ` Michal Marek
2016-02-08 18:13 ` Michal Marek
2016-02-09 14:54 ` Arnd Bergmann
2016-02-09 14:54 ` Arnd Bergmann
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.