linux/scripts/atomic
Arnd Bergmann 44472d1b83 atomic: Skip alignment check for try_cmpxchg() old arg
The 'old' argument in atomic_try_cmpxchg() and related functions is a
pointer to a normal non-atomic integer number, which does not require
to be naturally aligned, unlike the atomic_t/atomic64_t types themselves.

In order to add an alignment check with CONFIG_DEBUG_ATOMIC into the
normal instrument_atomic_read_write() helper, change this check to use
the non-atomic instrument_read_write(), the same way that was done
earlier for try_cmpxchg() in commit ec570320b0 ("locking/atomic:
Correct (cmp)xchg() instrumentation").

This prevents warnings on m68k calling the 32-bit atomic_try_cmpxchg()
with 16-bit aligned arguments as well as several more architectures
including x86-32 when calling atomic64_try_cmpxchg() with 32-bit
aligned u64 arguments.

Reported-by: Finn Thain <fthain@linux-m68k.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/all/cover.1757810729.git.fthain@linux-m68k.org/
2025-10-21 12:31:56 +02:00
..
fallbacks locking/atomic: scripts: simplify raw_atomic*() definitions 2023-06-05 09:57:22 +02:00
kerneldoc locking/atomic: scripts: fix ${atomic}_sub_and_test() kerneldoc 2024-06-05 15:52:34 +02:00
atomic-tbl.sh locking/atomic: scripts: generate kerneldoc comments 2023-06-05 09:57:23 +02:00
atomics.tbl locking/atomic: scripts: simplify raw_atomic*() definitions 2023-06-05 09:57:22 +02:00
gen-atomic-fallback.sh locking/atomic: Add generic support for sync_try_cmpxchg() and its fallback 2023-10-09 18:14:15 +02:00
gen-atomic-instrumented.sh atomic: Skip alignment check for try_cmpxchg() old arg 2025-10-21 12:31:56 +02:00
gen-atomic-long.sh locking/atomic: scripts: generate kerneldoc comments 2023-06-05 09:57:23 +02:00
gen-atomics.sh rust: Introduce atomic API helpers 2025-09-15 09:38:32 +02:00
gen-rust-atomic-helpers.sh rust: Introduce atomic API helpers 2025-09-15 09:38:32 +02:00