[tip:WIP.x86/core 1/1] arch/arm64/include/asm/atomic_lse.h:289:11: warning: unused variable 'n'
From: kernel test robot
Date: Wed Mar 19 2025 - 10:41:44 EST
Hi Ingo,
FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git WIP.x86/core
head: 9262ee6499954dd387e4507e03b84512ab100706
commit: 9262ee6499954dd387e4507e03b84512ab100706 [1/1] compiler/gcc: Make asm() templates asm __inline__() by default
config: arm64-randconfig-002-20250319 (https://download.01.org/0day-ci/archive/20250320/202503200011.p3NCuhkb-lkp@xxxxxxxxx/config)
compiler: aarch64-linux-gcc (GCC) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250320/202503200011.p3NCuhkb-lkp@xxxxxxxxx/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503200011.p3NCuhkb-lkp@xxxxxxxxx/
All warnings (new ones prefixed by >>):
In file included from <command-line>:0:0:
arch/arm64/include/asm/atomic_lse.h: In function '__lse__cmpxchg128':
include/linux/compiler_types.h:479:29: error: expected '(' before '__inline'
# define asm_inline __asm__ __inline
^
include/linux/compiler_types.h:480:19: note: in expansion of macro 'asm_inline'
# define asm(...) asm_inline(__VA_ARGS__)
^~~~~~~~~~
arch/arm64/include/asm/atomic_lse.h:290:28: note: in expansion of macro 'asm'
register unsigned long x0 asm ("x0") = o.low; \
^~~
arch/arm64/include/asm/atomic_lse.h:310:1: note: in expansion of macro '__CMPXCHG128'
__CMPXCHG128( , )
^~~~~~~~~~~~
include/linux/compiler_types.h:479:29: error: expected '(' before '__inline'
# define asm_inline __asm__ __inline
^
include/linux/compiler_types.h:480:19: note: in expansion of macro 'asm_inline'
# define asm(...) asm_inline(__VA_ARGS__)
^~~~~~~~~~
arch/arm64/include/asm/atomic_lse.h:291:28: note: in expansion of macro 'asm'
register unsigned long x1 asm ("x1") = o.high; \
^~~
arch/arm64/include/asm/atomic_lse.h:310:1: note: in expansion of macro '__CMPXCHG128'
__CMPXCHG128( , )
^~~~~~~~~~~~
include/linux/compiler_types.h:479:29: error: expected '(' before '__inline'
# define asm_inline __asm__ __inline
^
include/linux/compiler_types.h:480:19: note: in expansion of macro 'asm_inline'
# define asm(...) asm_inline(__VA_ARGS__)
^~~~~~~~~~
arch/arm64/include/asm/atomic_lse.h:292:28: note: in expansion of macro 'asm'
register unsigned long x2 asm ("x2") = n.low; \
^~~
arch/arm64/include/asm/atomic_lse.h:310:1: note: in expansion of macro '__CMPXCHG128'
__CMPXCHG128( , )
^~~~~~~~~~~~
include/linux/compiler_types.h:479:29: error: expected '(' before '__inline'
# define asm_inline __asm__ __inline
^
include/linux/compiler_types.h:480:19: note: in expansion of macro 'asm_inline'
# define asm(...) asm_inline(__VA_ARGS__)
^~~~~~~~~~
arch/arm64/include/asm/atomic_lse.h:293:28: note: in expansion of macro 'asm'
register unsigned long x3 asm ("x3") = n.high; \
^~~
arch/arm64/include/asm/atomic_lse.h:310:1: note: in expansion of macro '__CMPXCHG128'
__CMPXCHG128( , )
^~~~~~~~~~~~
include/linux/compiler_types.h:479:29: error: expected '(' before '__inline'
# define asm_inline __asm__ __inline
^
include/linux/compiler_types.h:480:19: note: in expansion of macro 'asm_inline'
# define asm(...) asm_inline(__VA_ARGS__)
^~~~~~~~~~
arch/arm64/include/asm/atomic_lse.h:294:28: note: in expansion of macro 'asm'
register unsigned long x4 asm ("x4") = (unsigned long)ptr; \
^~~
arch/arm64/include/asm/atomic_lse.h:310:1: note: in expansion of macro '__CMPXCHG128'
__CMPXCHG128( , )
^~~~~~~~~~~~
In file included from arch/arm64/include/asm/lse.h:16:0,
from arch/arm64/include/asm/cmpxchg.h:14,
from arch/arm64/include/asm/atomic.h:16,
from include/linux/atomic.h:7,
from include/asm-generic/bitops/atomic.h:5,
from arch/arm64/include/asm/bitops.h:25,
from include/linux/bitops.h:68,
from include/linux/log2.h:12,
from kernel/bounds.c:13:
>> arch/arm64/include/asm/atomic_lse.h:289:11: warning: unused variable 'n' [-Wunused-variable]
n = { .full = (new) }; \
^
arch/arm64/include/asm/atomic_lse.h:310:1: note: in expansion of macro '__CMPXCHG128'
__CMPXCHG128( , )
^~~~~~~~~~~~
In file included from <command-line>:0:0:
arch/arm64/include/asm/atomic_lse.h: In function '__lse__cmpxchg128_mb':
include/linux/compiler_types.h:479:29: error: expected '(' before '__inline'
# define asm_inline __asm__ __inline
^
include/linux/compiler_types.h:480:19: note: in expansion of macro 'asm_inline'
# define asm(...) asm_inline(__VA_ARGS__)
^~~~~~~~~~
arch/arm64/include/asm/atomic_lse.h:290:28: note: in expansion of macro 'asm'
register unsigned long x0 asm ("x0") = o.low; \
^~~
arch/arm64/include/asm/atomic_lse.h:311:1: note: in expansion of macro '__CMPXCHG128'
__CMPXCHG128(_mb, al, "memory")
^~~~~~~~~~~~
include/linux/compiler_types.h:479:29: error: expected '(' before '__inline'
# define asm_inline __asm__ __inline
^
include/linux/compiler_types.h:480:19: note: in expansion of macro 'asm_inline'
# define asm(...) asm_inline(__VA_ARGS__)
^~~~~~~~~~
arch/arm64/include/asm/atomic_lse.h:291:28: note: in expansion of macro 'asm'
register unsigned long x1 asm ("x1") = o.high; \
^~~
arch/arm64/include/asm/atomic_lse.h:311:1: note: in expansion of macro '__CMPXCHG128'
__CMPXCHG128(_mb, al, "memory")
^~~~~~~~~~~~
include/linux/compiler_types.h:479:29: error: expected '(' before '__inline'
# define asm_inline __asm__ __inline
^
include/linux/compiler_types.h:480:19: note: in expansion of macro 'asm_inline'
# define asm(...) asm_inline(__VA_ARGS__)
^~~~~~~~~~
arch/arm64/include/asm/atomic_lse.h:292:28: note: in expansion of macro 'asm'
register unsigned long x2 asm ("x2") = n.low; \
^~~
arch/arm64/include/asm/atomic_lse.h:311:1: note: in expansion of macro '__CMPXCHG128'
__CMPXCHG128(_mb, al, "memory")
^~~~~~~~~~~~
include/linux/compiler_types.h:479:29: error: expected '(' before '__inline'
# define asm_inline __asm__ __inline
^
include/linux/compiler_types.h:480:19: note: in expansion of macro 'asm_inline'
# define asm(...) asm_inline(__VA_ARGS__)
^~~~~~~~~~
arch/arm64/include/asm/atomic_lse.h:293:28: note: in expansion of macro 'asm'
register unsigned long x3 asm ("x3") = n.high; \
^~~
arch/arm64/include/asm/atomic_lse.h:311:1: note: in expansion of macro '__CMPXCHG128'
__CMPXCHG128(_mb, al, "memory")
^~~~~~~~~~~~
include/linux/compiler_types.h:479:29: error: expected '(' before '__inline'
# define asm_inline __asm__ __inline
^
include/linux/compiler_types.h:480:19: note: in expansion of macro 'asm_inline'
# define asm(...) asm_inline(__VA_ARGS__)
^~~~~~~~~~
arch/arm64/include/asm/atomic_lse.h:294:28: note: in expansion of macro 'asm'
register unsigned long x4 asm ("x4") = (unsigned long)ptr; \
^~~
arch/arm64/include/asm/atomic_lse.h:311:1: note: in expansion of macro '__CMPXCHG128'
__CMPXCHG128(_mb, al, "memory")
^~~~~~~~~~~~
In file included from arch/arm64/include/asm/lse.h:16:0,
from arch/arm64/include/asm/cmpxchg.h:14,
from arch/arm64/include/asm/atomic.h:16,
from include/linux/atomic.h:7,
from include/asm-generic/bitops/atomic.h:5,
from arch/arm64/include/asm/bitops.h:25,
from include/linux/bitops.h:68,
from include/linux/log2.h:12,
from kernel/bounds.c:13:
>> arch/arm64/include/asm/atomic_lse.h:289:11: warning: unused variable 'n' [-Wunused-variable]
n = { .full = (new) }; \
^
arch/arm64/include/asm/atomic_lse.h:311:1: note: in expansion of macro '__CMPXCHG128'
__CMPXCHG128(_mb, al, "memory")
^~~~~~~~~~~~
make[3]: *** [scripts/Makefile.build:102: kernel/bounds.s] Error 1 shuffle=804208462
make[3]: Target 'prepare' not remade because of errors.
make[2]: *** [Makefile:1269: prepare0] Error 2 shuffle=804208462
make[2]: Target 'prepare' not remade because of errors.
make[1]: *** [Makefile:251: __sub-make] Error 2 shuffle=804208462
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:251: __sub-make] Error 2 shuffle=804208462
make: Target 'prepare' not remade because of errors.
vim +/n +289 arch/arm64/include/asm/atomic_lse.h
c342f78217e822d Will Deacon 2015-04-23 283
b23e139d0b66c02 Peter Zijlstra 2023-05-31 284 #define __CMPXCHG128(name, mb, cl...) \
b23e139d0b66c02 Peter Zijlstra 2023-05-31 285 static __always_inline u128 \
b23e139d0b66c02 Peter Zijlstra 2023-05-31 286 __lse__cmpxchg128##name(volatile u128 *ptr, u128 old, u128 new) \
b23e139d0b66c02 Peter Zijlstra 2023-05-31 287 { \
b23e139d0b66c02 Peter Zijlstra 2023-05-31 288 union __u128_halves r, o = { .full = (old) }, \
b23e139d0b66c02 Peter Zijlstra 2023-05-31 @289 n = { .full = (new) }; \
b23e139d0b66c02 Peter Zijlstra 2023-05-31 290 register unsigned long x0 asm ("x0") = o.low; \
b23e139d0b66c02 Peter Zijlstra 2023-05-31 291 register unsigned long x1 asm ("x1") = o.high; \
b23e139d0b66c02 Peter Zijlstra 2023-05-31 292 register unsigned long x2 asm ("x2") = n.low; \
b23e139d0b66c02 Peter Zijlstra 2023-05-31 293 register unsigned long x3 asm ("x3") = n.high; \
b23e139d0b66c02 Peter Zijlstra 2023-05-31 294 register unsigned long x4 asm ("x4") = (unsigned long)ptr; \
b23e139d0b66c02 Peter Zijlstra 2023-05-31 295 \
b23e139d0b66c02 Peter Zijlstra 2023-05-31 296 asm volatile( \
b23e139d0b66c02 Peter Zijlstra 2023-05-31 297 __LSE_PREAMBLE \
b23e139d0b66c02 Peter Zijlstra 2023-05-31 298 " casp" #mb "\t%[old1], %[old2], %[new1], %[new2], %[v]\n"\
b23e139d0b66c02 Peter Zijlstra 2023-05-31 299 : [old1] "+&r" (x0), [old2] "+&r" (x1), \
b23e139d0b66c02 Peter Zijlstra 2023-05-31 300 [v] "+Q" (*(u128 *)ptr) \
b23e139d0b66c02 Peter Zijlstra 2023-05-31 301 : [new1] "r" (x2), [new2] "r" (x3), [ptr] "r" (x4), \
b23e139d0b66c02 Peter Zijlstra 2023-05-31 302 [oldval1] "r" (o.low), [oldval2] "r" (o.high) \
b23e139d0b66c02 Peter Zijlstra 2023-05-31 303 : cl); \
b23e139d0b66c02 Peter Zijlstra 2023-05-31 304 \
b23e139d0b66c02 Peter Zijlstra 2023-05-31 305 r.low = x0; r.high = x1; \
b23e139d0b66c02 Peter Zijlstra 2023-05-31 306 \
b23e139d0b66c02 Peter Zijlstra 2023-05-31 307 return r.full; \
b23e139d0b66c02 Peter Zijlstra 2023-05-31 308 }
b23e139d0b66c02 Peter Zijlstra 2023-05-31 309
:::::: The code at line 289 was first introduced by commit
:::::: b23e139d0b66c0216e7e9361a5021290395f504c arch: Introduce arch_{,try_}_cmpxchg128{,_local}()
:::::: TO: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
:::::: CC: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki