]> git.baikalelectronics.ru Git - kernel.git/commit
sparc64: Make atomic_xchg() an inline function rather than a macro.
authorDavid S. Miller <davem@davemloft.net>
Tue, 3 Apr 2018 15:24:35 +0000 (08:24 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Apr 2018 15:24:35 +0000 (08:24 -0700)
commit1145256ae3e615cf46a9e6932c4682f2348e8de0
treef44c955ab5afa697d91f214b74b5ed651a46db9d
parentd64e4d94b4fcc22fcb0b358eb3d1ee1b043ce5d7
sparc64: Make atomic_xchg() an inline function rather than a macro.

This avoids a lot of -Wunused warnings such as:

====================
kernel/debug/debug_core.c: In function ‘kgdb_cpu_enter’:
./arch/sparc/include/asm/cmpxchg_64.h:55:22: warning: value computed is not used [-Wunused-value]
 #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))

./arch/sparc/include/asm/atomic_64.h:86:30: note: in expansion of macro ‘xchg’
 #define atomic_xchg(v, new) (xchg(&((v)->counter), new))
                              ^~~~
kernel/debug/debug_core.c:508:4: note: in expansion of macro ‘atomic_xchg’
    atomic_xchg(&kgdb_active, cpu);
    ^~~~~~~~~~~
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/include/asm/atomic_64.h