Re: [PATCH] firmware/memmap: use scnprintf() in show funcs

From: Greg KH
Date: Tue Jul 01 2025 - 06:27:48 EST


On Fri, Jun 13, 2025 at 07:14:49PM +0530, Pranav Tyagi wrote:
> Replace all snprintf() instances with scnprintf(). snprintf() returns
> the number of bytes that would have been written had there been enough
> space. For sysfs attributes, snprintf() should not be used for the
> show() method. Instead use scnprintf() which returns the number of bytes
> actually written.

for sysfs attributes, sysfs_emit() should be used instead. Why not do
that here?

But what is wrong with the current code? Is it not working properly?

thanks,

greg k-h