[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aSdWZQmmvlvJr-Kn@smile.fi.intel.com>
Date: Wed, 26 Nov 2025 21:35:01 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Tomas Borquez <tomasborquez13@...il.com>
Cc: Jonathan Cameron <jic23@...nel.org>,
David Lechner <dlechner@...libre.com>,
Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] iio: isl29018.c: replace sprintf with safer
alternatives
On Wed, Nov 26, 2025 at 02:24:32PM -0300, Tomas Borquez wrote:
> This patch replaces sprintf with sysfs_emit and sysfs_emit_at safer alternative
sprintf()
"...sysfs_emit() and sysfs_emit_at()..."
alternatives
OR
"...sysfs_emit() or sysfs_emit_at()..."
> with no functional changes.
...
> - len += sprintf(buf + len, "%d.%06d ",
> + len += sysfs_emit_at(buf, len, "%d.%06d ",
> isl29018_scales[chip->int_time][i].scale,
> isl29018_scales[chip->int_time][i].uscale);
Forgot to update indentation.
...
> for (i = 0; i < ARRAY_SIZE(isl29018_int_utimes[chip->type]); ++i)
> - len += sprintf(buf + len, "0.%06d ",
> + len += sysfs_emit_at(buf, len, "0.%06d ",
> isl29018_int_utimes[chip->type][i]);
Ditto.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists