Skip to content

Commit

Permalink
alpha: remove undef inline in compiler.h
Browse files Browse the repository at this point in the history
since 889b3c1, CONFIG_OPTIMIZE_INLINING
is removed entirely and inline is always defined to `inline __gnu_inline
__inline_maybe_unused notrace` in compiler_types.h

Besides, undef inline here also means it never use
__attribute__((__gnu_inline__)), so `extern inline` function can never
be defined header files, otherwise multiple definition errors will
happen, e.g. if multiple translation units use alpha/include/asm/pal.h
will report multiple definitions, because there are many extern inline
function definitions in this header.

``` c
extern inline TYPE NAME(void)					\
{								\
	register TYPE __r0 __asm__("$0");			\
	__asm__ __volatile__(					\
...
```

Ofc, it is also ok to remove `extern` in `extern inline` here, then all
of iso c99 and gnuc99/89 are ok, but there are also other alpha headers
have such function definitions.

Signed-off-by: chenli <chenli@uniontech.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Chen Li authored and Matt Turner committed Jul 26, 2021
1 parent a09c33c commit 5e3c3a0
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions arch/alpha/include/asm/compiler.h
Original file line number Diff line number Diff line change
@@ -4,15 +4,4 @@

#include <uapi/asm/compiler.h>

/* Some idiots over in <linux/compiler.h> thought inline should imply
always_inline. This breaks stuff. We'll include this file whenever
we run into such problems. */

#include <linux/compiler.h>
#undef inline
#undef __inline__
#undef __inline
#undef __always_inline
#define __always_inline inline __attribute__((always_inline))

#endif /* __ALPHA_COMPILER_H */

0 comments on commit 5e3c3a0

Please sign in to comment.