From: Jan Blunck Date: Wed, 17 Jun 2009 11:49:44 +0000 (+0200) Subject: s390: Fix some compiler warnings X-Git-Tag: v0.1~108 X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=commitdiff_plain;h=a9a05d424419e9293ff9ac48e0c650ed0850a486;hp=98dcc5ca0ba740c56ecbc1f1c9d2977ef1b2a969 s390: Fix some compiler warnings Fix warning about _atomic_exchange being defined but unused and explicitly cast the 2nd argument. Signed-off-by: Jan Blunck --- diff --git a/arch_atomic_s390.h b/arch_atomic_s390.h index cb85e6a..37fb89f 100644 --- a/arch_atomic_s390.h +++ b/arch_atomic_s390.h @@ -29,7 +29,7 @@ #ifndef _INCLUDE_API_H -static __attribute__((always_inline)) +static inline __attribute__((always_inline)) unsigned int atomic_exchange_32(volatile unsigned int *addr, unsigned int val) { unsigned int result; @@ -46,7 +46,7 @@ unsigned int atomic_exchange_32(volatile unsigned int *addr, unsigned int val) #if (BITS_PER_LONG == 64) -static __attribute__((always_inline)) +static inline __attribute__((always_inline)) unsigned long atomic_exchange_64(volatile unsigned long *addr, unsigned long val) { @@ -64,7 +64,7 @@ unsigned long atomic_exchange_64(volatile unsigned long *addr, #endif -static __attribute__((always_inline)) +static inline __attribute__((always_inline)) unsigned long _atomic_exchange(volatile void *addr, unsigned long val, int len) { switch (len) { @@ -81,8 +81,9 @@ unsigned long _atomic_exchange(volatile void *addr, unsigned long val, int len) return 0; } -#define xchg(addr, v) (__typeof__(*(addr))) _atomic_exchange((addr), (v), \ - sizeof(*(addr))) +#define xchg(addr, v) \ + (__typeof__(*(addr))) _atomic_exchange((addr), (unsigned long)(v), \ + sizeof(*(addr))) #endif /* #ifndef _INCLUDE_API_H */