From: Jiri Slaby <jirislaby@kernel.org>
To: tang.dongxing@zte.com.cn, jgross@suse.com
Cc: sstabellini@kernel.org, oleksandr_tyshchenko@epam.com,
jiqian.chen@amd.com, ray.huang@amd.com,
jeff.johnson@oss.qualcomm.com, minhuadotchen@gmail.com,
xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
ye.xingchen@zte.com.cn, yang.guang5@zte.com.cn,
yang.yang29@zte.com.cn, xu.xin16@zte.com.cn
Subject: Re: [PATCH] xen/pciback: use sysfs_emit_at() instead of scnprintf()
Date: Mon, 17 Mar 2025 09:50:47 +0100 [thread overview]
Message-ID: <23781043-901b-422c-8199-10aa4a31459e@kernel.org> (raw)
In-Reply-To: <20250317151648132Sj7qhbVfKcPYvqCievFUf@zte.com.cn>
On 17. 03. 25, 8:16, tang.dongxing@zte.com.cn wrote:
> From: TangDongxing <tang.dongxing@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: TangDongxing <tang.dongxing@zte.com.cn>
> ---
> drivers/xen/xen-pciback/pci_stub.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c
> index b616b7768c3b..a0782a74ed34 100644
> --- a/drivers/xen/xen-pciback/pci_stub.c
> +++ b/drivers/xen/xen-pciback/pci_stub.c
> @@ -1281,7 +1281,7 @@ static ssize_t slots_show(struct device_driver *drv, char *buf)
> if (count >= PAGE_SIZE)
> break;
>
> - count += scnprintf(buf + count, PAGE_SIZE - count,
> + count += sysfs_emit_at(buf, count,
This is wrong too [1].
[1]
https://lore.kernel.org/all/9c552d9a-2d46-4069-a9c4-35fab857bfc3@kernel.org/
regards,
--
js
suse labs
next prev parent reply other threads:[~2025-03-17 8:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-17 7:16 tang.dongxing
2025-03-17 8:50 ` Jiri Slaby [this message]
2025-03-17 9:18 ` tang.dongxing
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=23781043-901b-422c-8199-10aa4a31459e@kernel.org \
--to=jirislaby@kernel.org \
--cc=jeff.johnson@oss.qualcomm.com \
--cc=jgross@suse.com \
--cc=jiqian.chen@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=minhuadotchen@gmail.com \
--cc=oleksandr_tyshchenko@epam.com \
--cc=ray.huang@amd.com \
--cc=sstabellini@kernel.org \
--cc=tang.dongxing@zte.com.cn \
--cc=xen-devel@lists.xenproject.org \
--cc=xu.xin16@zte.com.cn \
--cc=yang.guang5@zte.com.cn \
--cc=yang.yang29@zte.com.cn \
--cc=ye.xingchen@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
all inboxes | Powered by JetHome®