Re: [PATCH 02/17] locking/rtmutex: assert static storage for DEFINE_RT_MUTEX()
From: sashiko-bot
Date: Mon Sep 14 2026 - 23:27:12 EST
> DEFINE_RT_MUTEX() statically initializes both the mutex lockdep map and
> its internal wait lock. An automatic local object cannot supply the
> persistent class key expected by this initialization.
>
> Add ASSERT_STATIC_STORAGE() to reject automatic declarations. Such mutexes
> must use rt_mutex_init(); file-scope and static local definitions remain
> valid. Leave __RT_MUTEX_INITIALIZER() available for embedded objects.
>
> Assisted-by: OpenAI Codex
> Signed-off-by: Yury Norov <ynorov@xxxxxxxxxx>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260915030336.1192299-1-ynorov@xxxxxxxxxx?part=2