summaryrefslogtreecommitdiff
path: root/include/linux/rwlock.h
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2026-02-25 10:32:41 -0800
committerPeter Zijlstra <peterz@infradead.org>2026-02-27 16:40:19 +0100
commit38e18d825f7281fdc16d3241df5115ce6eaeaf79 (patch)
treea171794c95fd53189d5461340940adb1b5af4832 /include/linux/rwlock.h
parent50214dc4382055352fb1d7b9779550dabf5059e5 (diff)
locking: Fix rwlock and spinlock lock context annotations
Fix two incorrect rwlock_t lock context annotations. Add the raw_spinlock_t lock context annotations that are missing. Fixes: f16a802d402d ("locking/rwlock, spinlock: Support Clang's context analysis") Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Marco Elver <elver@google.com> Link: https://patch.msgid.link/20260225183244.4035378-2-bvanassche@acm.org
Diffstat (limited to 'include/linux/rwlock.h')
-rw-r--r--include/linux/rwlock.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/rwlock.h b/include/linux/rwlock.h
index 3390d21c95dd..21ceefc4a49f 100644
--- a/include/linux/rwlock.h
+++ b/include/linux/rwlock.h
@@ -30,10 +30,10 @@ do { \
#ifdef CONFIG_DEBUG_SPINLOCK
extern void do_raw_read_lock(rwlock_t *lock) __acquires_shared(lock);
- extern int do_raw_read_trylock(rwlock_t *lock);
+ extern int do_raw_read_trylock(rwlock_t *lock) __cond_acquires_shared(true, lock);
extern void do_raw_read_unlock(rwlock_t *lock) __releases_shared(lock);
extern void do_raw_write_lock(rwlock_t *lock) __acquires(lock);
- extern int do_raw_write_trylock(rwlock_t *lock);
+extern int do_raw_write_trylock(rwlock_t *lock) __cond_acquires(true, lock);
extern void do_raw_write_unlock(rwlock_t *lock) __releases(lock);
#else
# define do_raw_read_lock(rwlock) do {__acquire_shared(lock); arch_read_lock(&(rwlock)->raw_lock); } while (0)