* [PATCH v2] xen-pciback: Replace scnprintf() with sysfs_emit_at()
@ 2025-06-24 7:04 Ryan Chung
2025-07-01 7:32 ` Jürgen Groß
2025-07-08 0:14 ` [PATCH v3] " Ryan Chung
0 siblings, 2 replies; 4+ messages in thread
From: Ryan Chung @ 2025-06-24 7:04 UTC (permalink / raw)
To: jgross, sstabellini, oleksandr_tyshchenko
Cc: linux-kernel, linux-kernel-mentees, Ryan Chung
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@gmail.com>
---
drivers/xen/xen-pciback/pci_stub.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c
index 5c2f829d5b0b..045e74847fe6 100644
--- a/drivers/xen/xen-pciback/pci_stub.c
+++ b/drivers/xen/xen-pciback/pci_stub.c
@@ -1261,7 +1261,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 +1290,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",
@@ -1375,7 +1375,7 @@ static ssize_t quirks_show(struct device_driver *drv, char *buf)
if (count >= PAGE_SIZE)
goto out;
- count += scnprintf(buf + count, PAGE_SIZE - count,
+ count += sysfs_emit_at(buf, count,
"%02x:%02x.%01x\n\t%04x:%04x:%04x:%04x\n",
quirk->pdev->bus->number,
PCI_SLOT(quirk->pdev->devfn),
@@ -1391,7 +1391,7 @@ static ssize_t quirks_show(struct device_driver *drv, char *buf)
if (count >= PAGE_SIZE)
goto out;
- count += scnprintf(buf + count, PAGE_SIZE - count,
+ count += sysfs_emit_at(buf, count,
"\t\t%08x:%01x:%08x\n",
cfg_entry->base_offset +
field->offset, field->size,
@@ -1462,7 +1462,7 @@ static ssize_t permissive_show(struct device_driver *drv, char *buf)
if (!dev_data || !dev_data->permissive)
continue;
count +=
- scnprintf(buf + count, PAGE_SIZE - count, "%s\n",
+ sysfs_emit_at(buf, count, "%s\n",
pci_name(psdev->dev));
}
spin_unlock_irqrestore(&pcistub_devices_lock, flags);
@@ -1521,7 +1521,7 @@ static ssize_t allow_interrupt_control_show(struct device_driver *drv,
if (!dev_data || !dev_data->allow_interrupt_control)
continue;
count +=
- scnprintf(buf + count, PAGE_SIZE - count, "%s\n",
+ sysfs_emit_at(buf, count, "%s\n",
pci_name(psdev->dev));
}
spin_unlock_irqrestore(&pcistub_devices_lock, flags);
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] xen-pciback: Replace scnprintf() with sysfs_emit_at()
2025-06-24 7:04 [PATCH v2] xen-pciback: Replace scnprintf() with sysfs_emit_at() Ryan Chung
@ 2025-07-01 7:32 ` Jürgen Groß
2025-07-07 7:52 ` Ryan Chung
2025-07-08 0:14 ` [PATCH v3] " Ryan Chung
1 sibling, 1 reply; 4+ messages in thread
From: Jürgen Groß @ 2025-07-01 7:32 UTC (permalink / raw)
To: Ryan Chung, sstabellini, oleksandr_tyshchenko
Cc: linux-kernel, linux-kernel-mentees
[-- Attachment #1.1.1: Type: text/plain, Size: 325 bytes --]
On 24.06.25 09:04, Ryan Chung wrote:
> 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@gmail.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Juergen
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] xen-pciback: Replace scnprintf() with sysfs_emit_at()
2025-07-01 7:32 ` Jürgen Groß
@ 2025-07-07 7:52 ` Ryan Chung
0 siblings, 0 replies; 4+ messages in thread
From: Ryan Chung @ 2025-07-07 7:52 UTC (permalink / raw)
To: Jürgen Groß
Cc: sstabellini, oleksandr_tyshchenko, linux-kernel,
linux-kernel-mentees
On Tue, Jul 01, 2025 at 09:32:31AM +0200, Jürgen Groß wrote:
> On 24.06.25 09:04, Ryan Chung wrote:
> > 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@gmail.com>
>
> Reviewed-by: Juergen Gross <jgross@suse.com>
>
>
> Juergen
Thank you. I will send the v3 shortly.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v3] xen-pciback: Replace scnprintf() with sysfs_emit_at()
2025-06-24 7:04 [PATCH v2] xen-pciback: Replace scnprintf() with sysfs_emit_at() Ryan Chung
2025-07-01 7:32 ` Jürgen Groß
@ 2025-07-08 0:14 ` Ryan Chung
1 sibling, 0 replies; 4+ messages in thread
From: Ryan Chung @ 2025-07-08 0:14 UTC (permalink / raw)
To: jgross, sstabellini, oleksandr_tyshchenko
Cc: linux-kernel, linux-kernel-mentees, Ryan Chung
This is the third revision (v3) of this patch series.
No changes since v2—only adding Reviewed-by lines.
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Ryan Chung <seokwoo.chung130@gmail.com>
---
drivers/xen/xen-pciback/pci_stub.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c
index 5c2f829d5b0b..045e74847fe6 100644
--- a/drivers/xen/xen-pciback/pci_stub.c
+++ b/drivers/xen/xen-pciback/pci_stub.c
@@ -1261,7 +1261,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 +1290,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",
@@ -1375,7 +1375,7 @@ static ssize_t quirks_show(struct device_driver *drv, char *buf)
if (count >= PAGE_SIZE)
goto out;
- count += scnprintf(buf + count, PAGE_SIZE - count,
+ count += sysfs_emit_at(buf, count,
"%02x:%02x.%01x\n\t%04x:%04x:%04x:%04x\n",
quirk->pdev->bus->number,
PCI_SLOT(quirk->pdev->devfn),
@@ -1391,7 +1391,7 @@ static ssize_t quirks_show(struct device_driver *drv, char *buf)
if (count >= PAGE_SIZE)
goto out;
- count += scnprintf(buf + count, PAGE_SIZE - count,
+ count += sysfs_emit_at(buf, count,
"\t\t%08x:%01x:%08x\n",
cfg_entry->base_offset +
field->offset, field->size,
@@ -1462,7 +1462,7 @@ static ssize_t permissive_show(struct device_driver *drv, char *buf)
if (!dev_data || !dev_data->permissive)
continue;
count +=
- scnprintf(buf + count, PAGE_SIZE - count, "%s\n",
+ sysfs_emit_at(buf, count, "%s\n",
pci_name(psdev->dev));
}
spin_unlock_irqrestore(&pcistub_devices_lock, flags);
@@ -1521,7 +1521,7 @@ static ssize_t allow_interrupt_control_show(struct device_driver *drv,
if (!dev_data || !dev_data->allow_interrupt_control)
continue;
count +=
- scnprintf(buf + count, PAGE_SIZE - count, "%s\n",
+ sysfs_emit_at(buf, count, "%s\n",
pci_name(psdev->dev));
}
spin_unlock_irqrestore(&pcistub_devices_lock, flags);
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-07-08 0:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-24 7:04 [PATCH v2] xen-pciback: Replace scnprintf() with sysfs_emit_at() Ryan Chung
2025-07-01 7:32 ` Jürgen Groß
2025-07-07 7:52 ` Ryan Chung
2025-07-08 0:14 ` [PATCH v3] " Ryan Chung
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox