Re: [PATCH v2] iio: light: tsl2583: migrate to sysfs_emit() and sysfs_emit_at()

From: Andy Shevchenko

Date: Tue Jul 14 2026 - 09:57:00 EST


On Tue, Jul 14, 2026 at 09:39:00PM +0800, OrangeBlack0765@xxxxxxxxxxx wrote:

First of all, do not reply with a new version into the thread from
the previous one.

> Replace sprintf() with sysfs_emit() for single-value sysfs show
> functions, and use sysfs_emit_at() for lux_table_show() which
> concatenates multiple values. This ensures buffer safety and
> follows the modern kernel sysfs API.

> Changes in v2:
> - Fix indentation for multi-line function arguments (align with first param)

Next, the changelog should be in the comments block...

> Signed-off-by: Chengrui Liu <OrangeBlack0765@xxxxxxxxxxx>
> ---

...somewhere here (mind the cutter '---' line).

> drivers/iio/light/tsl2583.c | 12 ++++++------

...

> + offset += sysfs_emit_at(buf, offset, "%u,%u,%u,",
> + chip->als_settings.als_device_lux[i].ratio,
> + chip->als_settings.als_device_lux[i].ch0,
> + chip->als_settings.als_device_lux[i].ch1);

And last, but not least. Indentation is still broken. Now it's mix tabs
and spaces (in a wrong order).

...

Do not hurry up with v3, wait at least 24+h.

--
With Best Regards,
Andy Shevchenko