diff options
author | Steve Langasek <vorlon@debian.org> | 2006-02-07 15:58:35 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-07 19:12:31 -0500 |
commit | c00a76aea339b427b47ddc28de06dee0a652e801 (patch) | |
tree | be6267266d399952f54a2fd4d991a610bb42b43a /include/asm-alpha/system.h | |
parent | c2f8311d3168ed7d391ba5df5b80f4af0a3457d0 (diff) |
[PATCH] __cmpxchg() must really always be inlined on alpha
With the latest 2.6.15 kernel builds for alpha on Debian, we ran into a
problem with undefined references to __cmpxchg_called_with_bad_pointer() in
a couple of kernel modules (xfs.ko and drm.ko; see
http://bugs.debian.org/347556).
It looks like people have been trying to out-clever each other wrt the
definition of "inline" on this architecture :), with the result that
__cmpxchg(), which must be inlined so the compiler can see its argument is
const, is not guaranteed to be inlined. Indeed, it was not being inlined
when building with -Os.
The attached patch fixes the issue by adding an
__attribute__((always_inline)) explicitly to the definition of __cmpxchg()
instead of relying on redefines of "inline" elsewhere to make this happen.
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-alpha/system.h')
-rw-r--r-- | include/asm-alpha/system.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h index cc9c7e8cced5..f3b7b1a59c56 100644 --- a/include/asm-alpha/system.h +++ b/include/asm-alpha/system.h | |||
@@ -572,7 +572,7 @@ __cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new) | |||
572 | if something tries to do an invalid cmpxchg(). */ | 572 | if something tries to do an invalid cmpxchg(). */ |
573 | extern void __cmpxchg_called_with_bad_pointer(void); | 573 | extern void __cmpxchg_called_with_bad_pointer(void); |
574 | 574 | ||
575 | static inline unsigned long | 575 | static __always_inline unsigned long |
576 | __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) | 576 | __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) |
577 | { | 577 | { |
578 | switch (size) { | 578 | switch (size) { |