mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-22 09:22:37 +00:00
m32r: fix build warning
Some m32r builds were having a warning:
arch/m32r/include/asm/cmpxchg.h:191:3: warning: value computed is not used
arch/m32r/include/asm/cmpxchg.h:68:3: warning: value computed is not used
Taking the idea from commit e001bbae71
("ARM: cmpxchg: avoid warnings
from macro-ized cmpxchg() implementations") the m32r implementation is
changed to use a similar construct with a compound expression instead of
a typecast, which causes the compiler to not complain about an unused
result.
Link: http://lkml.kernel.org/r/1484432664-7015-1-git-send-email-sudipm.mukherjee@gmail.com
Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
6408b6fb99
commit
af0de7815e
@ -64,8 +64,10 @@ __xchg(unsigned long x, volatile void *ptr, int size)
|
||||
return (tmp);
|
||||
}
|
||||
|
||||
#define xchg(ptr, x) \
|
||||
((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
|
||||
#define xchg(ptr, x) ({ \
|
||||
((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), \
|
||||
sizeof(*(ptr)))); \
|
||||
})
|
||||
|
||||
static __always_inline unsigned long
|
||||
__xchg_local(unsigned long x, volatile void *ptr, int size)
|
||||
@ -187,9 +189,12 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
|
||||
return old;
|
||||
}
|
||||
|
||||
#define cmpxchg(ptr, o, n) \
|
||||
((__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)(o), \
|
||||
(unsigned long)(n), sizeof(*(ptr))))
|
||||
#define cmpxchg(ptr, o, n) ({ \
|
||||
((__typeof__(*(ptr))) \
|
||||
__cmpxchg((ptr), (unsigned long)(o), \
|
||||
(unsigned long)(n), \
|
||||
sizeof(*(ptr)))); \
|
||||
})
|
||||
|
||||
#include <asm-generic/cmpxchg-local.h>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user