sparclinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <xie.ludan@zte.com.cn>
To: <andreas@gaisler.com>
Cc: <davem@davemloft.net>, <gregkh@linuxfoundation.org>,
	<ukleinek@kernel.org>, <jonathan.cameron@huawei.com>,
	<xie.ludan@zte.com.cn>, <mathieu.poirier@linaro.org>,
	<quic_zijuhu@quicinc.com>, <sparclinux@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <xu.xin16@zte.com.cn>,
	<yang.yang29@zte.com.cn>
Subject: [PATCH linux-next] sparc/vio: use sysfs_emit() instead of scnprintf().
Date: Mon, 17 Mar 2025 16:04:56 +0800 (CST)	[thread overview]
Message-ID: <20250317160456854fAJoK7WQI_J5R7rPeyfxh@zte.com.cn> (raw)

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

             reply	other threads:[~2025-03-17  8:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-17  8:04 xie.ludan [this message]
2025-03-17 13:54 ` [PATCH linux-next] sparc/vio: use sysfs_emit() instead of scnprintf() Greg KH

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=20250317160456854fAJoK7WQI_J5R7rPeyfxh@zte.com.cn \
    --to=xie.ludan@zte.com.cn \
    --cc=andreas@gaisler.com \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=quic_zijuhu@quicinc.com \
    --cc=sparclinux@vger.kernel.org \
    --cc=ukleinek@kernel.org \
    --cc=xu.xin16@zte.com.cn \
    --cc=yang.yang29@zte.com.cn \
    /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 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).