mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-10 14:43:54 +08:00
m68k: Avoid xchg() warning
gcc warns about the value of xchg()/cmpxchg() being unused in some cases: net/core/filter.c: In function 'bpf_clear_redirect_map': arch/m68k/include/asm/cmpxchg.h:137:3: warning: value computed is not used [-Wunused-value] 106 | #define cmpxchg(ptr, o, n) cmpxchg_local((ptr), (o), (n)) net/core/filter.c:3595:4: note: in expansion of macro 'cmpxchg' 3595 | cmpxchg(&ri->map, map, NULL); Shut up that warning like we do on other architectures, by turning the macro into a statement expression. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20201008123429.1133896-1-arnd@arndb.de Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
This commit is contained in:
parent
3650b228f8
commit
1e10cf448f
@ -76,7 +76,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#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)));})
|
||||||
|
|
||||||
#include <asm-generic/cmpxchg-local.h>
|
#include <asm-generic/cmpxchg-local.h>
|
||||||
|
|
||||||
@ -119,11 +119,11 @@ static inline unsigned long __cmpxchg(volatile void *p, unsigned long old,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define cmpxchg(ptr, o, n) \
|
#define cmpxchg(ptr, o, n) \
|
||||||
((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \
|
({(__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \
|
||||||
(unsigned long)(n), sizeof(*(ptr))))
|
(unsigned long)(n), sizeof(*(ptr)));})
|
||||||
#define cmpxchg_local(ptr, o, n) \
|
#define cmpxchg_local(ptr, o, n) \
|
||||||
((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \
|
({(__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \
|
||||||
(unsigned long)(n), sizeof(*(ptr))))
|
(unsigned long)(n), sizeof(*(ptr)));})
|
||||||
|
|
||||||
#define cmpxchg64(ptr, o, n) cmpxchg64_local((ptr), (o), (n))
|
#define cmpxchg64(ptr, o, n) cmpxchg64_local((ptr), (o), (n))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user