Re: [PATCH 12/17] timers: assert static storage for DEFINE_TIMER()
From: Thomas Gleixner
Date: Tue Sep 29 2026 - 14:51:28 EST
On Mon, Sep 14 2026 at 23:13, Yury Norov wrote:
> DEFINE_TIMER() marks a timer as statically initialized for debugobjects.
> An automatic local timer instead needs timer_setup_on_stack() and the
> corresponding on-stack destruction before leaving scope.
>
> Add ASSERT_STATIC_STORAGE() to catch automatic declarations at compile
> time. The timer lockdep key is already static; this check enforces the
> debugobjects storage contract. Leave __TIMER_INITIALIZER() unchanged.
>
> Assisted-by: OpenAI Codex
> Signed-off-by: Yury Norov <ynorov@xxxxxxxxxx>
Reviewed-by: Thomas Gleixner <tglx@xxxxxxxxxx>