]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
compiler-context-analysis: Change __cond_acquires to take return value
authorMarco Elver <elver@google.com>
Fri, 19 Dec 2025 15:39:58 +0000 (16:39 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 5 Jan 2026 15:43:29 +0000 (16:43 +0100)
commit38f1311a2219220a3962fae464ca6300ef60b4c1
treea99570831ebeea71c0227f8d50c05e85b047d37c
parentf16a802d402d735a55731f8c94952b3bbb5ddfe8
compiler-context-analysis: Change __cond_acquires to take return value

While Sparse is oblivious to the return value of conditional acquire
functions, Clang's context analysis needs to know the return value
which indicates successful acquisition.

Add the additional argument, and convert existing uses.

Notably, Clang's interpretation of the value merely relates to the use
in a later conditional branch, i.e. 1 ==> context lock acquired in
branch taken if condition non-zero, and 0 ==> context lock acquired in
branch taken if condition is zero. Given the precise value does not
matter, introduce symbolic variants to use instead of either 0 or 1,
which should be more intuitive.

No functional change intended.

Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20251219154418.3592607-10-elver@google.com
fs/dlm/lock.c
include/linux/compiler-context-analysis.h
include/linux/refcount.h
include/linux/spinlock.h
include/linux/spinlock_api_smp.h
net/ipv4/tcp_sigpool.c