Re: [PATCHv2 07/17] nvme: add Clang context annotations for nvme_subsystem::lock

Christoph Hellwig <[email protected]>
Newsgroups org.infradead.lists.linux-nvme,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.