[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aGQ0re136jUaPN-o@smile.fi.intel.com>
Date: Tue, 1 Jul 2025 22:19:09 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Chelsy Ratnawat <chelsyratnawat2001@...il.com>
Cc: jean-baptiste.maneyrol@....com, jic23@...nel.org, dlechner@...libre.com,
nuno.sa@...log.com, andy@...nel.org, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] iio: imu: inv_mpu6050: Replace scnprintf with
sysfs_emit
On Tue, Jul 01, 2025 at 08:47:20AM -0700, Chelsy Ratnawat wrote:
> Documentation/filesystems/sysfs.rst mentions that show() should only
> use sysfs_emit() or sysfs_emit_at() when formating the value to be
> returned to user space. So replace scnprintf() with sysfs_emit().
...
> - return scnprintf(buf, PAGE_SIZE,
> - "%d, %d, %d; %d, %d, %d; %d, %d, %d\n",
> + return sysfs_emit(buf, "%d, %d, %d; %d, %d, %d; %d, %d, %d\n",
> m[0], m[1], m[2], m[3], m[4], m[5], m[6], m[7], m[8]);
Ideally second line should be reindented, but I won't be bothered by that
right now.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists