Skip to content

Commit 77abd3b

Browse files
Sebastian Andrzej SiewiorKAGA-KOKO
authored andcommitted
locking/rt: Annotate unlock followed by lock for sparse.
rt_mutex_slowlock_block() and rtlock_slowlock_locked() both unlock lock::wait_lock and then lock it later. This is unusual and sparse complains about it. Add __releases() + __acquires() annotation to mark that it is expected. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 168660b commit 77abd3b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/locking/rtmutex.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,6 +1601,7 @@ static int __sched rt_mutex_slowlock_block(struct rt_mutex_base *lock,
16011601
unsigned int state,
16021602
struct hrtimer_sleeper *timeout,
16031603
struct rt_mutex_waiter *waiter)
1604+
__releases(&lock->wait_lock) __acquires(&lock->wait_lock)
16041605
{
16051606
struct rt_mutex *rtm = container_of(lock, struct rt_mutex, rtmutex);
16061607
struct task_struct *owner;
@@ -1805,6 +1806,7 @@ static __always_inline int __rt_mutex_lock(struct rt_mutex_base *lock,
18051806
* @lock: The underlying RT mutex
18061807
*/
18071808
static void __sched rtlock_slowlock_locked(struct rt_mutex_base *lock)
1809+
__releases(&lock->wait_lock) __acquires(&lock->wait_lock)
18081810
{
18091811
struct rt_mutex_waiter waiter;
18101812
struct task_struct *owner;

0 commit comments

Comments
 (0)