On 17. 03. 25, 8:16, [email protected] wrote:
From: TangDongxing <[email protected]>

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 <[email protected]>
---
  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/[email protected]/

regards,
--
js
suse labs


Reply via email to