git: 44d36c9731c1 - main - netmap: Use device_set_descf()

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Sun, 16 Jun 2024 20:37:49 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=44d36c9731c172977ad8a95a09c0d6fbddcc9b2f

commit 44d36c9731c172977ad8a95a09c0d6fbddcc9b2f
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-06-05 14:17:14 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-06-16 20:37:26 +0000

    netmap: Use device_set_descf()
    
    No functional change intended.
    
    MFC after:      1 week
---
 sys/dev/netmap/netmap_freebsd.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/sys/dev/netmap/netmap_freebsd.c b/sys/dev/netmap/netmap_freebsd.c
index a4a0124471c0..cf3578ddc7fe 100644
--- a/sys/dev/netmap/netmap_freebsd.c
+++ b/sys/dev/netmap/netmap_freebsd.c
@@ -864,16 +864,12 @@ nm_os_pt_memdev_iounmap(struct ptnetmap_memdev *ptn_dev)
 static int
 ptn_memdev_probe(device_t dev)
 {
-	char desc[256];
-
 	if (pci_get_vendor(dev) != PTNETMAP_PCI_VENDOR_ID)
 		return (ENXIO);
 	if (pci_get_device(dev) != PTNETMAP_PCI_DEVICE_ID)
 		return (ENXIO);
 
-	snprintf(desc, sizeof(desc), "%s PCI adapter",
-			PTNETMAP_MEMDEV_NAME);
-	device_set_desc_copy(dev, desc);
+	device_set_descf(dev, "%s PCI adapter", PTNETMAP_MEMDEV_NAME);
 
 	return (BUS_PROBE_DEFAULT);
 }