[paulmckrcu:dev 20/44] include/asm-generic/rwonce.h:44:71: error: lvalue required as unary '&' operand
kernel test robot <[email protected]> Thu, 30 Jul 2026 22:59:07 +0800
| Newsgroups | dev.linux.lists.oe-kbuild-all |
|---|---|
| Message-ID | <[email protected]> |
tree: https://github.com/paulmckrcu/linux dev
head: 9df1c10e4ddffa50d054112facefa25376c7a219
commit: 5fac52664a4c35c288966854574589a2d08c8107 [20/44] hrtimer: Apply {READ,WRITE}_ONCE() to hrtimer_resolution accesses
config: x86_64-buildonly-randconfig-006-20260730 (https://download.01.org/0day-ci/archive/20260730/[email protected]/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260730/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
In file included from ./arch/x86/include/generated/asm/rwonce.h:1,
from include/linux/compiler.h:369,
from include/linux/export.h:5,
from include/linux/linkage.h:7,
from arch/x86/include/asm/cache.h:5,
from include/vdso/cache.h:5,
from include/linux/cache.h:6,
from include/linux/time.h:5,
from include/linux/compat.h:10,
from kernel/time/posix-timers.c:12:
kernel/time/posix-timers.c: In function 'posix_get_hrtimer_res':
>> include/asm-generic/rwonce.h:44:71: error: lvalue required as unary '&' operand
44 | #define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
| ^
include/asm-generic/rwonce.h:50:9: note: in expansion of macro '__READ_ONCE'
50 | __READ_ONCE(x); \
| ^~~~~~~~~~~
kernel/time/posix-timers.c:275:23: note: in expansion of macro 'READ_ONCE'
275 | tp->tv_nsec = READ_ONCE(hrtimer_resolution);
| ^~~~~~~~~
--
In file included from ./arch/x86/include/generated/asm/rwonce.h:1,
from include/linux/compiler.h:369,
from include/linux/proc_fs.h:8,
from kernel/time/timer_list.c:8:
kernel/time/timer_list.c: In function 'print_base':
>> include/asm-generic/rwonce.h:44:71: error: lvalue required as unary '&' operand
44 | #define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
| ^
include/asm-generic/rwonce.h:50:9: note: in expansion of macro '__READ_ONCE'
50 | __READ_ONCE(x); \
| ^~~~~~~~~~~
kernel/time/timer_list.c:102:52: note: in expansion of macro 'READ_ONCE'
102 | SEQ_printf(m, " .resolution: %u nsecs\n", READ_ONCE(hrtimer_resolution));
| ^~~~~~~~~
--
In file included from ./arch/x86/include/generated/asm/rwonce.h:1,
from include/linux/compiler.h:369,
from include/linux/dev_printk.h:14,
from include/linux/device.h:15,
from include/linux/node.h:18,
from include/linux/cpu.h:17,
from kernel/time/hrtimer.c:25:
kernel/time/hrtimer.c: In function 'hrtimer_forward':
>> include/asm-generic/rwonce.h:44:71: error: lvalue required as unary '&' operand
44 | #define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
| ^
include/asm-generic/rwonce.h:50:9: note: in expansion of macro '__READ_ONCE'
50 | __READ_ONCE(x); \
| ^~~~~~~~~~~
kernel/time/hrtimer.c:1075:15: note: in expansion of macro 'READ_ONCE'
1075 | res = READ_ONCE(hrtimer_resolution);
| ^~~~~~~~~
vim +44 include/asm-generic/rwonce.h
e506ea451254ab1 Will Deacon 2019-10-15 28
e506ea451254ab1 Will Deacon 2019-10-15 29 /*
e506ea451254ab1 Will Deacon 2019-10-15 30 * Yes, this permits 64-bit accesses on 32-bit architectures. These will
e506ea451254ab1 Will Deacon 2019-10-15 31 * actually be atomic in some cases (namely Armv7 + LPAE), but for others we
e506ea451254ab1 Will Deacon 2019-10-15 32 * rely on the access being split into 2x32-bit accesses for a 32-bit quantity
e506ea451254ab1 Will Deacon 2019-10-15 33 * (e.g. a virtual address) and a strong prevailing wind.
e506ea451254ab1 Will Deacon 2019-10-15 34 */
e506ea451254ab1 Will Deacon 2019-10-15 35 #define compiletime_assert_rwonce_type(t) \
e506ea451254ab1 Will Deacon 2019-10-15 36 compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
e506ea451254ab1 Will Deacon 2019-10-15 37 "Unsupported access size for {READ,WRITE}_ONCE().")
e506ea451254ab1 Will Deacon 2019-10-15 38
e506ea451254ab1 Will Deacon 2019-10-15 39 /*
e506ea451254ab1 Will Deacon 2019-10-15 40 * Use __READ_ONCE() instead of READ_ONCE() if you do not require any
3c9184109e78ea2 Will Deacon 2019-10-30 41 * atomicity. Note that this may result in tears!
e506ea451254ab1 Will Deacon 2019-10-15 42 */
b78b331a3f5c077 Will Deacon 2019-10-15 43 #ifndef __READ_ONCE
e506ea451254ab1 Will Deacon 2019-10-15 @44 #define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
b78b331a3f5c077 Will Deacon 2019-10-15 45 #endif
e506ea451254ab1 Will Deacon 2019-10-15 46
:::::: The code at line 44 was first introduced by commit
:::::: e506ea451254ab17e0bf918ca36232fec2a9b10c compiler.h: Split {READ,WRITE}_ONCE definitions out into rwonce.h
:::::: TO: Will Deacon <[email protected]>
:::::: CC: Will Deacon <[email protected]>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki