Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xen-pciback: Replace scnprintf() with sysfs_emit_at()

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>

authored by

Ryan Chung and committed by
Juergen Gross
c7962689 b7efeb08

+6 -6
+6 -6
drivers/xen/xen-pciback/pci_stub.c
··· 1261 1261 if (count >= PAGE_SIZE) 1262 1262 break; 1263 1263 1264 - count += scnprintf(buf + count, PAGE_SIZE - count, 1264 + count += sysfs_emit_at(buf, count, 1265 1265 "%04x:%02x:%02x.%d\n", 1266 1266 pci_dev_id->domain, pci_dev_id->bus, 1267 1267 PCI_SLOT(pci_dev_id->devfn), ··· 1290 1290 if (!dev_data) 1291 1291 continue; 1292 1292 count += 1293 - scnprintf(buf + count, PAGE_SIZE - count, 1293 + sysfs_emit_at(buf, count, 1294 1294 "%s:%s:%sing:%ld\n", 1295 1295 pci_name(psdev->dev), 1296 1296 dev_data->isr_on ? "on" : "off", ··· 1375 1375 if (count >= PAGE_SIZE) 1376 1376 goto out; 1377 1377 1378 - count += scnprintf(buf + count, PAGE_SIZE - count, 1378 + count += sysfs_emit_at(buf, count, 1379 1379 "%02x:%02x.%01x\n\t%04x:%04x:%04x:%04x\n", 1380 1380 quirk->pdev->bus->number, 1381 1381 PCI_SLOT(quirk->pdev->devfn), ··· 1391 1391 if (count >= PAGE_SIZE) 1392 1392 goto out; 1393 1393 1394 - count += scnprintf(buf + count, PAGE_SIZE - count, 1394 + count += sysfs_emit_at(buf, count, 1395 1395 "\t\t%08x:%01x:%08x\n", 1396 1396 cfg_entry->base_offset + 1397 1397 field->offset, field->size, ··· 1462 1462 if (!dev_data || !dev_data->permissive) 1463 1463 continue; 1464 1464 count += 1465 - scnprintf(buf + count, PAGE_SIZE - count, "%s\n", 1465 + sysfs_emit_at(buf, count, "%s\n", 1466 1466 pci_name(psdev->dev)); 1467 1467 } 1468 1468 spin_unlock_irqrestore(&pcistub_devices_lock, flags); ··· 1521 1521 if (!dev_data || !dev_data->allow_interrupt_control) 1522 1522 continue; 1523 1523 count += 1524 - scnprintf(buf + count, PAGE_SIZE - count, "%s\n", 1524 + sysfs_emit_at(buf, count, "%s\n", 1525 1525 pci_name(psdev->dev)); 1526 1526 } 1527 1527 spin_unlock_irqrestore(&pcistub_devices_lock, flags);