summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarco Elver <elver@google.com>2026-01-19 10:05:56 +0100
committerPeter Zijlstra <peterz@infradead.org>2026-01-28 20:45:25 +0100
commitb682b70d016f6aee20d91dcbaa319a932008a83a (patch)
treeff33bbdfb99ddde139c1b5bb32b99b662eaa8083 /lib
parent41539433b32d71aea9f7ada84dc6a8bd014ca50d (diff)
compiler-context-analysis: Remove __assume_ctx_lock from initializers
Remove __assume_ctx_lock() from lock initializers. Implicitly asserting an active context during initialization caused false-positive double-lock errors when acquiring a lock immediately after its initialization. Moving forward, guarded member initialization must either: 1. Use guard(type_init)(&lock) or scoped_guard(type_init, ...). 2. Use context_unsafe() for simple initialization. Reported-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Marco Elver <elver@google.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/all/57062131-e79e-42c2-aa0b-8f931cb8cac2@acm.org/ Link: https://patch.msgid.link/20260119094029.1344361-7-elver@google.com
Diffstat (limited to 'lib')
-rw-r--r--lib/test_context-analysis.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/lib/test_context-analysis.c b/lib/test_context-analysis.c
index 0f05943d957f..140efa8a9763 100644
--- a/lib/test_context-analysis.c
+++ b/lib/test_context-analysis.c
@@ -542,12 +542,6 @@ struct test_ww_mutex_data {
int counter __guarded_by(&mtx);
};
-static void __used test_ww_mutex_init(struct test_ww_mutex_data *d)
-{
- ww_mutex_init(&d->mtx, &ww_class);
- d->counter = 0;
-}
-
static void __used test_ww_mutex_lock_noctx(struct test_ww_mutex_data *d)
{
if (!ww_mutex_lock(&d->mtx, NULL)) {