Re: [PATCH] gpio: sim: Remove intermediate pointer variable and harden function

From: Bartosz Golaszewski

Date: Fri Apr 24 2026 - 09:14:52 EST


On Fri, Apr 24, 2026 at 3:05 PM Maxwell Doose <m32285159@xxxxxxxxx> wrote:
>
> On Fri, Apr 24, 2026 at 2:54 AM Bartosz Golaszewski <brgl@xxxxxxxxxx> wrote:
> >
> > Do you believe the code looks better with more layered dereferences?
> >
>
> I think some people might value the more explicit dereferencing, and with this
> we also won't need to handle the overhead of assigning another pointer, but if
> you want this removed thats fine by me.
>

I prefer to keep it as is.

> > sprintf() is safe here as we cannot possibly exceed PAGE_SIZE with
> > this format but if you really want to do this, than please send a
> > separate patch converting all configfs show callbacks in the driver.
>
> I can do that, but I'd prefer to separate the functional changes with
> this one, so
> expect another patch that fixes these. I'll remove those sysfs_emit changes for
> now so that the commit history will be clean for when I come back with this
> second patch.
>

Sure, let's drop the first part and do the conversion of the configfs
show callbacks

Bart