[ltt-dev] [PATCH 5/5] s390: Fix some compiler warnings

Jan Blunck jblunck at suse.de
Wed Jun 17 08:09:29 EDT 2009


Fix warning about _atomic_exchange being defined but unused and explicitly
cast the 2nd argument.

Signed-off-by: Jan Blunck <jblunck at suse.de>
---
 arch_atomic_s390.h |   11 ++++++-----
 1 files 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 */
 
-- 
1.6.1.3





More information about the lttng-dev mailing list