Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] Add Sparse annotations to SRCU wrapper functions in rcutorture

The SRCU wrapper functions srcu_torture_read_lock and
srcu_torture_read_unlock in rcutorture intentionally change the SRCU
context; annotate them accordingly, to avoid a warning.

Signed-off-by: Josh Triplett <josh@freedesktop.org>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Josh Triplett and committed by
Linus Torvalds
012d3ca8 a09c17a6

+2 -2
+2 -2
kernel/rcutorture.c
··· 401 401 cleanup_srcu_struct(&srcu_ctl); 402 402 } 403 403 404 - static int srcu_torture_read_lock(void) 404 + static int srcu_torture_read_lock(void) __acquires(&srcu_ctl) 405 405 { 406 406 return srcu_read_lock(&srcu_ctl); 407 407 } ··· 419 419 schedule_timeout_interruptible(longdelay); 420 420 } 421 421 422 - static void srcu_torture_read_unlock(int idx) 422 + static void srcu_torture_read_unlock(int idx) __releases(&srcu_ctl) 423 423 { 424 424 srcu_read_unlock(&srcu_ctl, idx); 425 425 }