Re: [PATCH 0/8] nvmem: make reg_write() take a const void *
From: Link Mauve
Date: Wed Jul 15 2026 - 15:10:57 EST
On Wed, Jul 15, 2026 at 10:02:13PM +0300, Andy Shevchenko wrote:
> On Wed, Jul 15, 2026 at 07:52:16PM +0200, Link Mauve wrote:
> > This callback used to take a mutable void * for no reason, which causes
> > the compiler to be unaware that the val buffer should never be modified
> > by the callback.
> >
> > This was found while drafting the nvmem-provider Rust abstraction.
> >
> > I’ve split this series based on the subsystem each patch affects, but I
> > think it should go through the nvmem tree in one go after gathering the
> > acks from the other subsystem maintainers.
>
> It's an option. The other option (and often we go this way) is to introduce
> a new name, convert users, convert the name back.
Thanks for the hint, I’ll go for this route for v2 then.
>
> See, for example, how GPIO subsystem changed a proto of .set() callback.
I will, thanks.
>
> > I’ve been told previously to not include too many maintainers in Cc, but
> > I don’t know which ones to remove from the get_maintainers.pl output, so
> > I’ve still included everyone, sorry about that.
>
> With this, rather standard, way you will fulfill the above requirement
> automatically. Also you won't need treewide change to bother everybody
> with this. And also increase the chances to go in (maybe in a few releases
> span).
I originally thought given how few users of this API there are in the
kernel, it would be simpler to fix them all in one go, but that might be
a better option then.
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
--
Link Mauve