From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Di Wu <diwux@google.com>
Cc: jic23@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com,
andy@kernel.org, bleung@chromium.org, groeck@chromium.org,
tzungbi@kernel.org, linux-iio@vger.kernel.org,
chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: cros_ec: use sysfs_emit() in show callbacks
Date: Wed, 11 Nov 2026 16:39:37 +0200 [thread overview]
Message-ID: <avR-KT-6e77EexZn@ashevche-desk.local> (raw)
In-Reply-To: <20261111072608.3490763-1-diwux@google.com>
On Wed, Nov 11, 2026 at 07:26:08AM +0000, Di Wu wrote:
> Replace sprintf() and snprintf() with sysfs_emit() in the sysfs show
> and ext_info read callbacks. sysfs_emit() is aware of the sysfs buffer
> PAGE_SIZE limit and is the preferred helper for show callbacks.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
...
> - return sprintf(buf, "%d.%06u\n",
> - latency / 1000,
> - (latency % 1000) * 1000);
> + return sysfs_emit(buf, "%d.%06u\n",
> + latency / 1000,
> + (latency % 1000) * 1000);
As David said, since you touched these lines, make the less amount of them
while at it.
(But no need to resend, usually Jonathan is kind to tweak this small thing.)
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2026-11-11 14:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 7:26 Di Wu
2026-11-11 8:36 ` Benson Leung
2026-11-11 11:17 ` David Laight
2026-11-11 14:39 ` Andy Shevchenko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=avR-KT-6e77EexZn@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=diwux@google.com \
--cc=dlechner@baylibre.com \
--cc=groeck@chromium.org \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=tzungbi@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®