* [PATCH] iio: light: stk3310: replace sprintf() with safer sysfs_emit()
@ 2026-10-23 20:25 Adi Kadušić
2026-10-23 20:40 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Adi Kadušić @ 2026-10-23 20:25 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Adi Kadušić, David Lechner, Nuno Sá,
Andy Shevchenko, Joshua Crofts, Jorijn van der Graaf, Miao Li,
Uwe Kleine-König (The Capable Hub),
Rafael G. Dias, Pan Chuang, linux-iio, linux-kernel
This patch replaces sprintf() with sysfs_emit() safer alternative
with no functional changes.
Signed-off-by: Adi Kadušić <kadusicadi1@gmail.com>
---
drivers/iio/light/stk3310.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c
index 0a16e326e939..e751e7c97bc1 100644
--- a/drivers/iio/light/stk3310.c
+++ b/drivers/iio/light/stk3310.c
@@ -18,7 +18,6 @@
#include <linux/pm.h>
#include <linux/property.h>
#include <linux/regmap.h>
-#include <linux/sprintf.h>
#include <linux/sysfs.h>
#include <linux/types.h>
@@ -180,7 +179,7 @@ static ssize_t stk3310_read_near_level(struct iio_dev *indio_dev,
{
struct stk3310_data *data = iio_priv(indio_dev);
- return sprintf(buf, "%u\n", data->ps_near_level);
+ return sysfs_emit(buf, "%u\n", data->ps_near_level);
}
static const struct iio_chan_spec_ext_info stk3310_ext_info[] = {
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] iio: light: stk3310: replace sprintf() with safer sysfs_emit()
2026-10-23 20:25 [PATCH] iio: light: stk3310: replace sprintf() with safer sysfs_emit() Adi Kadušić
@ 2026-10-23 20:40 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2026-10-23 20:40 UTC (permalink / raw)
To: Adi Kadušić
Cc: David Lechner, Nuno Sá,
Andy Shevchenko, Joshua Crofts, Jorijn van der Graaf, Miao Li,
Uwe Kleine-König (The Capable Hub),
Rafael G. Dias, Pan Chuang, linux-iio, linux-kernel
On Fri, 23 Oct 2026 22:25:40 +0200
Adi Kadušić <kadusicadi1@gmail.com> wrote:
> This patch replaces sprintf() with sysfs_emit() safer alternative
> with no functional changes.
>
> Signed-off-by: Adi Kadušić <kadusicadi1@gmail.com>
Applied.
> ---
> drivers/iio/light/stk3310.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c
> index 0a16e326e939..e751e7c97bc1 100644
> --- a/drivers/iio/light/stk3310.c
> +++ b/drivers/iio/light/stk3310.c
> @@ -18,7 +18,6 @@
> #include <linux/pm.h>
> #include <linux/property.h>
> #include <linux/regmap.h>
> -#include <linux/sprintf.h>
> #include <linux/sysfs.h>
> #include <linux/types.h>
>
> @@ -180,7 +179,7 @@ static ssize_t stk3310_read_near_level(struct iio_dev *indio_dev,
> {
> struct stk3310_data *data = iio_priv(indio_dev);
>
> - return sprintf(buf, "%u\n", data->ps_near_level);
> + return sysfs_emit(buf, "%u\n", data->ps_near_level);
> }
>
> static const struct iio_chan_spec_ext_info stk3310_ext_info[] = {
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-23 20:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-23 20:25 [PATCH] iio: light: stk3310: replace sprintf() with safer sysfs_emit() Adi Kadušić
2026-10-23 20:40 ` Jonathan Cameron
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®