From: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
To: "Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>
Cc: Donggeun Yoo <donggeunyoo.kernel@gmail.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] iio: light: vcnl4000: use sysfs_emit() for near_level
Date: Sun, 30 Aug 2026 14:42:36 +0900 [thread overview]
Message-ID: <20260830054237.2147950-1-donggeunyoo.kernel@gmail.com> (raw)
Use sysfs_emit() instead of sprintf() for writing to the sysfs
output buffer. sysfs_emit() is aware of the buffer's PAGE_SIZE
limit and is the preferred helper for sysfs callbacks.
Signed-off-by: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
---
drivers/iio/light/vcnl4000.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c
index 336468d59ea7..dac235dd6220 100644
--- a/drivers/iio/light/vcnl4000.c
+++ b/drivers/iio/light/vcnl4000.c
@@ -1504,7 +1504,7 @@ static ssize_t vcnl4000_read_near_level(struct iio_dev *indio_dev,
{
struct vcnl4000_data *data = iio_priv(indio_dev);
- return sprintf(buf, "%u\n", data->near_level);
+ return sysfs_emit(buf, "%u\n", data->near_level);
}
static irqreturn_t vcnl4010_irq_thread(int irq, void *p)
base-commit: 350d1fb9204b13c5f95e511e98b8bcb47574d425
--
2.53.0
next reply other threads:[~2026-08-30 5:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-30 5:42 Donggeun Yoo [this message]
2026-08-30 15:41 ` [PATCH] iio: light: vcnl4000: use sysfs_emit() for near_level Joshua Crofts
2026-08-30 19:01 ` Donggeun Yoo
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=20260830054237.2147950-1-donggeunyoo.kernel@gmail.com \
--to=donggeunyoo.kernel@gmail.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.