All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Tomas Borquez <tomasborquez13@gmail.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] iio: isl29018.c: replace sprintf with safer alternatives
Date: Wed, 26 Nov 2025 21:35:01 +0200	[thread overview]
Message-ID: <aSdWZQmmvlvJr-Kn@smile.fi.intel.com> (raw)
In-Reply-To: <20251126172432.5532-1-tomasborquez13@gmail.com>

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



  reply	other threads:[~2025-11-26 19:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-26 17:24 [PATCH v2] iio: isl29018.c: replace sprintf with safer alternatives Tomas Borquez
2025-11-26 19:35 ` Andy Shevchenko [this message]
2025-11-26 20:43   ` Tomas Borquez
2025-12-07 16:02     ` Jonathan Cameron
2025-11-26 20:32 ` [PATCH v3] " Tomas Borquez
2025-11-26 21:09   ` Andy Shevchenko
2025-11-26 21:46     ` Tomas Borquez
2025-11-26 21:54       ` Andy Shevchenko
2025-12-07 16:04         ` Jonathan Cameron

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=aSdWZQmmvlvJr-Kn@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.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 \
    --cc=tomasborquez13@gmail.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.