[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250317160456854fAJoK7WQI_J5R7rPeyfxh@zte.com.cn>
Date: Mon, 17 Mar 2025 16:04:56 +0800 (CST)
From: <xie.ludan@....com.cn>
To: <andreas@...sler.com>
Cc: <davem@...emloft.net>, <gregkh@...uxfoundation.org>, <ukleinek@...nel.org>,
<jonathan.cameron@...wei.com>, <xie.ludan@....com.cn>,
<mathieu.poirier@...aro.org>, <quic_zijuhu@...cinc.com>,
<sparclinux@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<xu.xin16@....com.cn>, <yang.yang29@....com.cn>
Subject: [PATCH linux-next] sparc/vio: use sysfs_emit() instead of scnprintf().
From: XieLudan <xie.ludan@....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@....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
Powered by blists - more mailing lists