Re: [PATCH] iio: adc: ad7816: use sysfs_emit() instead of sprintf()

From: Jonathan Cameron

Date: Tue Apr 21 2026 - 11:07:41 EST


On Mon, 20 Apr 2026 14:30:05 +0200
Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:

> On Mon, Apr 20, 2026 at 08:27:20PM +0900, Minu Jin wrote:
> > Replace sprintf() with sysfs_emit().
> > sysfs_emit() is preferred than sprintf() in show() functions.
>
> For _new_ functions, not existing ones.
>
> > It has aware of the PAGE_SIZE buffer limit and ensures safe buffer handling.
>
> Are any of the current usages incorrect? If not, no need to change
> this.
>

I wouldn't mind it if part of more general cleanup and modernisation, particularly
if that was touching the relevant bit of the code.

Before sending a patch check if anything similar is on list.
There is one other near identical one I rejected and a more significant
cleanup series that is undergoing revisions...

Thanks,

Jonathan

> thanks,
>
> greg k-h
>