sparclinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux-next] sparc/vio: use sysfs_emit() instead of scnprintf().
@ 2025-03-17  8:04 xie.ludan
  2025-03-17 13:54 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: xie.ludan @ 2025-03-17  8:04 UTC (permalink / raw)
  To: andreas
  Cc: davem, gregkh, ukleinek, jonathan.cameron, xie.ludan,
	mathieu.poirier, quic_zijuhu, sparclinux, linux-kernel, xu.xin16,
	yang.yang29

From: XieLudan <xie.ludan@zte.com.cn>

Follow the advice in Documentation/filesystems/sysfs.rst:
show() should only use sysfs_emit() or sysfs_emit_at() when formatting
the value to be returned to user space.

Signed-off-by: XieLudan <xie.ludan@zte.com.cn>
---
 arch/sparc/kernel/vio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c
index 1a1a9d6b8f2e..cbf38eca8d83 100644
--- a/arch/sparc/kernel/vio.c
+++ b/arch/sparc/kernel/vio.c
@@ -191,7 +191,7 @@ show_pciobppath_attr(struct device *dev, struct device_attribute *attr,
 	vdev = to_vio_dev(dev);
 	dp = vdev->dp;

-	return scnprintf(buf, PAGE_SIZE, "%pOF\n", dp);
+	return sysfs_emit(buf, "%pOF\n", dp);
 }

 static DEVICE_ATTR(obppath, S_IRUSR | S_IRGRP | S_IROTH,
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH linux-next] sparc/vio: use sysfs_emit() instead of scnprintf().
  2025-03-17  8:04 [PATCH linux-next] sparc/vio: use sysfs_emit() instead of scnprintf() xie.ludan
@ 2025-03-17 13:54 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2025-03-17 13:54 UTC (permalink / raw)
  To: xie.ludan
  Cc: andreas, davem, ukleinek, jonathan.cameron, mathieu.poirier,
	quic_zijuhu, sparclinux, linux-kernel, xu.xin16, yang.yang29

On Mon, Mar 17, 2025 at 04:04:56PM +0800, xie.ludan@zte.com.cn wrote:
> From: XieLudan <xie.ludan@zte.com.cn>
> 
> Follow the advice in Documentation/filesystems/sysfs.rst:
> show() should only use sysfs_emit() or sysfs_emit_at() when formatting
> the value to be returned to user space.
> 
> Signed-off-by: XieLudan <xie.ludan@zte.com.cn>
> ---
>  arch/sparc/kernel/vio.c | 2 +-

Do you have this hardware and have tested it?  If not, I wouldn't mess
with existing code, just follow the documentation for new submissions,
leave old stuff alone as it's already working.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-03-17 13:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-17  8:04 [PATCH linux-next] sparc/vio: use sysfs_emit() instead of scnprintf() xie.ludan
2025-03-17 13:54 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).