From a9a05d424419e9293ff9ac48e0c650ed0850a486 Mon Sep 17 00:00:00 2001 From: Jan Blunck Date: Wed, 17 Jun 2009 13:49:44 +0200 Subject: [PATCH 1/1] 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 --- arch_atomic_s390.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 */ -- 2.34.1