]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xen-pciback: Replace scnprintf() with sysfs_emit_at()
authorRyan Chung <seokwoo.chung130@gmail.com>
Tue, 8 Jul 2025 00:14:40 +0000 (09:14 +0900)
committerJuergen Gross <jgross@suse.com>
Mon, 14 Jul 2025 07:35:42 +0000 (09:35 +0200)
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>
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-ID: <20250708001444.86155-1-seokwoo.chung130@gmail.com>

drivers/xen/xen-pciback/pci_stub.c

index 5c2f829d5b0bb299244ed9f5b84272de0715a8ce..045e74847fe6b06fcd236436f08c42f2d4979717 100644 (file)
@@ -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);