Re: [PATCH] iio: st_lsm6dsx: Replace scnprintf with sysfs_emit
From: Andy Shevchenko
Date: Wed Jul 02 2025 - 10:56:09 EST
On Wed, Jul 02, 2025 at 09:16:51AM -0500, David Lechner wrote:
> On 7/2/25 8:58 AM, Akshay Bansod wrote:
> > Update the sysfs interface for sampling frequency and scale attributes.
> > Replace `scnprintf()` with `sysfs_emit_at()` which is PAGE_SIZE-aware
> > and recommended for use in sysfs.
...
> > + len += sysfs_emit_at(buf, len, "%d.%03d ",
> > odr_table->odr_avl[i].milli_hz / 1000,
> > odr_table->odr_avl[i].milli_hz % 1000);
>
> Let's keep checkpatch happy and change the indent of the wrapped lines to
> line up with ( since the ( moved.
While I see the point, wouldn't be better to have 1000 replaced with MILLI
at the same time?
--
With Best Regards,
Andy Shevchenko