lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250624032632.63845-1-seokwoo.chung130@gmail.com>
Date: Tue, 24 Jun 2025 12:26:32 +0900
From: Ryan Chung <seokwoo.chung130@...il.com>
To: jgross@...e.com,
	sstabellini@...nel.org,
	oleksandr_tyshchenko@...m.com
Cc: linux-kernel@...r.kernel.org,
	Ryan Chung <seokwoo.chung130@...il.com>
Subject: [PATCH] xen-pciback: Use sysfs_emit_at() in slots_show() and irq_handlers_show()

Replace the use of scnprintf() with sysfs_emit_at() in slots_show() and irq_handlers_show().

This change uses sysfs_emit() API usage for sysfs 'show'
functions as recommended from Documentation/filesystems/sysfs.rst. 

No functional change intended.

Signed-off-by: Ryan Chung <seokwoo.chung130@...il.com>
---
 drivers/xen/xen-pciback/pci_stub.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c
index 5c2f829d5b0b..d0a889474a46 100644
--- a/drivers/xen/xen-pciback/pci_stub.c
+++ b/drivers/xen/xen-pciback/pci_stub.c
@@ -18,6 +18,7 @@
 #include <linux/wait.h>
 #include <linux/sched.h>
 #include <linux/atomic.h>
+#include <linux/sysfs.h>
 #include <xen/events.h>
 #include <xen/pci.h>
 #include <xen/xen.h>
@@ -30,6 +31,7 @@
 #include "conf_space.h"
 #include "conf_space_quirks.h"
 
+
 #define PCISTUB_DRIVER_NAME "pciback"
 
 static char *pci_devs_to_hide;
@@ -720,7 +722,7 @@ static void kill_domain_by_device(struct pcistub_device *psdev)
 		return;
 	}
 	/*PV AER handlers will set this flag*/
-	xenbus_printf(xbt, nodename, "aerState" , "aerfail");
+	xenbus_printf(xbt, nodename, "aerState", "aerfail");
 	err = xenbus_transaction_end(xbt, 0);
 	if (err) {
 		if (err == -EAGAIN)
@@ -1261,7 +1263,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,
 				   "%04x:%02x:%02x.%d\n",
 				   pci_dev_id->domain, pci_dev_id->bus,
 				   PCI_SLOT(pci_dev_id->devfn),
@@ -1290,7 +1292,7 @@ static ssize_t irq_handlers_show(struct device_driver *drv, char *buf)
 		if (!dev_data)
 			continue;
 		count +=
-		    scnprintf(buf + count, PAGE_SIZE - count,
+		    sysfs_emit_at(buf, count,
 			      "%s:%s:%sing:%ld\n",
 			      pci_name(psdev->dev),
 			      dev_data->isr_on ? "on" : "off",
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ