Re: [PATCH v4] iio: proximity: srf08: Replace sprintf() with sysfs_emit()

From: Andy Shevchenko

Date: Wed Apr 22 2026 - 03:03:30 EST


On Tue, Apr 21, 2026 at 04:35:26PM -0500, Maxwell Doose wrote:
> Replace sprintf() function calls with sysfs_emit() and
> sysfs_emit_at(). While the current code is fine, sysfs_emit() is
> preferred over sprintf(), and will help modernize the driver.

...

> - Changed sysfs_emit() call in function srf08_show_range()
> to be on one line to resolve issues around indentation
> alignment.

Wrong. We assume 80 character limits unless this makes readability suffer.

...

> for (i = 0; i < data->chip_info->num_sensitivity_avail; i++)
> if (data->chip_info->sensitivity_avail[i])
> - len += sprintf(buf + len, "%d ",
> + len += sysfs_emit_at(buf, len, "%d ",
> data->chip_info->sensitivity_avail[i]);

Still the same issue as per v3.

--
With Best Regards,
Andy Shevchenko