From d67154523cb4e7d356e82615631f943d09aba647 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Thu, 5 Nov 2015 12:43:26 -0200 Subject: m68k: Use the generic bitops headers The generic bitops headers are required when calling logarithmic functions, such as ilog2(). Signed-off-by: Fabio Estevam Reviewed-by: Tom Rini Reviewed-by: Heiko Schocher Reviewed-by: Jagan Teki --- arch/m68k/include/asm/bitops.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch/m68k/include/asm/bitops.h') diff --git a/arch/m68k/include/asm/bitops.h b/arch/m68k/include/asm/bitops.h index f9c434b4a3..69ea26a729 100644 --- a/arch/m68k/include/asm/bitops.h +++ b/arch/m68k/include/asm/bitops.h @@ -6,6 +6,10 @@ #define _M68K_BITOPS_H #include +#include +#include +#include +#include extern void set_bit(int nr, volatile void *addr); extern void clear_bit(int nr, volatile void *addr); -- cgit v1.2.1 From 44d0677a90f82eb2b01dd5150ca8e0115453d7d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5ns=20Rullg=C3=A5rd?= Date: Fri, 6 Nov 2015 12:44:01 +0000 Subject: Replace "extern inline" with "static inline" A number of headers define functions as "extern inline" which is causing problems with gcc5. The reason is that starting with version 5.1, gcc defaults to the standard C99 semantics for the inline keyword. Under the traditional GNU inline semantics, an "extern inline" function would never create an external definition, the same as inline *without* extern in C99. In C99, and "extern inline" definition is simply an external definition with an inline hint. In short, the meanings of inline with and without extern are swapped between GNU and C99. The upshot is that all these definitions in header files create an external definition wherever those headers are included, resulting in multiple definition errors at link time. Changing all these functions to "static inline" fixes the problem since this works as desired in all gcc versions. Although the semantics are slightly different (a static inline definition may result in an actual function being emitted), it works as intended in practice. This patch also removes extern prototype declarations for the changed functions where they existed. Signed-off-by: Mans Rullgard --- arch/m68k/include/asm/bitops.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'arch/m68k/include/asm/bitops.h') diff --git a/arch/m68k/include/asm/bitops.h b/arch/m68k/include/asm/bitops.h index 69ea26a729..4a3f6b97ad 100644 --- a/arch/m68k/include/asm/bitops.h +++ b/arch/m68k/include/asm/bitops.h @@ -14,21 +14,20 @@ extern void set_bit(int nr, volatile void *addr); extern void clear_bit(int nr, volatile void *addr); extern void change_bit(int nr, volatile void *addr); -extern int test_and_set_bit(int nr, volatile void *addr); extern int test_and_clear_bit(int nr, volatile void *addr); extern int test_and_change_bit(int nr, volatile void *addr); #ifdef __KERNEL__ -extern inline int test_bit(int nr, __const__ volatile void *addr) +static inline int test_bit(int nr, __const__ volatile void *addr) { __const__ unsigned int *p = (__const__ unsigned int *) addr; return (p[nr >> 5] & (1UL << (nr & 31))) != 0; } -extern inline int test_and_set_bit(int nr, volatile void *vaddr) +static inline int test_and_set_bit(int nr, volatile void *vaddr) { char retval; -- cgit v1.2.1