lockdep/selftests: Use SBRM APIs for wait context tests
authorBoqun Feng <boqun.feng@gmail.com>
Sat, 15 Jul 2023 23:52:57 +0000 (16:52 -0700)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 26 Jul 2023 10:29:13 +0000 (12:29 +0200)
commitf66c538098b61e2eb596bb88fae90dbd2cebb378
tree6f83a87048cd66f6a2a7304c3f4b6cadb356dfab
parent6eaae198076080886b9e7d57f4ae06fa782f90ef
lockdep/selftests: Use SBRM APIs for wait context tests

The "__cleanup__" attribute is already used for wait context tests, so
using it for locking tests has already been proven working. Now since
SBRM APIs are merged, let's use these APIs instead of a local guard
framework. This also helps testing SBRM APIs.

Note that originally the tests don't rely on the cleanup ordering of
two variables in the same scope, but since now it's something we'd like
to assume and rely on[1], drop the extra scope in inner_in_outer()
function. Again this gives us another opportunity to test the compiler
behavior.

[1]: https://lore.kernel.org/lkml/CAHk-=whEsr6fuVSdsoNPokLR2fZiGuo_hCLyrS-LCw7hT_N7cQ@mail.gmail.com/
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20230715235257.110325-1-boqun.feng@gmail.com
lib/locking-selftest.c