Re: [PATCHv2 07/17] nvme: add Clang context annotations for nvme_subsystem::lock
From: Christoph Hellwig
Date: Thu Jul 09 2026 - 02:20:25 EST
On Tue, Jun 30, 2026 at 01:12:55AM +0200, Marco Elver wrote:
> Initialization of guarded objects has gone through a few iterations,
And all of them suck badly, with the current one being the worse.
> so I don't want to open that can of worms again. I think the
> infrastructure we have now provides various options (the scoped guard
> machinery isn't the only way). You could just write:
>
> /* Initializes unpublished lock-guarded variables. */
> context_unsafe(
> INIT_LIST_HEAD(&subsys->nsheads);
> // ... other guarded var init in same block ...
> );
Using all these silly context makes it total mess unfortunately.