git: 9da1b6dc161b - main - bxe: Use device_set_descf()

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

URL: https://cgit.FreeBSD.org/src/commit/?id=9da1b6dc161bfd7b494ba472cde33af49ef8196f

commit 9da1b6dc161bfd7b494ba472cde33af49ef8196f
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-06-05 19:24:16 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-06-16 20:37:26 +0000

    bxe: Use device_set_descf()
    
    No functional change intended.
    
    MFC after:      1 week
---
 sys/dev/bxe/bxe.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c
index 8350d02cb2a3..38a45de95083 100644
--- a/sys/dev/bxe/bxe.c
+++ b/sys/dev/bxe/bxe.c
@@ -2489,7 +2489,6 @@ static int
 bxe_probe(device_t dev)
 {
     struct bxe_device_type *t;
-    char *descbuf;
     uint16_t did, sdid, svid, vid;
 
     /* Find our device structure */
@@ -2506,20 +2505,12 @@ bxe_probe(device_t dev)
         if ((vid == t->bxe_vid) && (did == t->bxe_did) &&
             ((svid == t->bxe_svid) || (t->bxe_svid == PCI_ANY_ID)) &&
             ((sdid == t->bxe_sdid) || (t->bxe_sdid == PCI_ANY_ID))) {
-            descbuf = malloc(BXE_DEVDESC_MAX, M_TEMP, M_NOWAIT);
-            if (descbuf == NULL)
-                return (ENOMEM);
-
-            /* Print out the device identity. */
-            snprintf(descbuf, BXE_DEVDESC_MAX,
+            device_set_descf(dev,
                      "%s (%c%d) BXE v:%s", t->bxe_name,
                      (((pci_read_config(dev, PCIR_REVID, 4) &
                         0xf0) >> 4) + 'A'),
                      (pci_read_config(dev, PCIR_REVID, 4) & 0xf),
                      BXE_DRIVER_VERSION);
-
-            device_set_desc_copy(dev, descbuf);
-            free(descbuf, M_TEMP);
             return (BUS_PROBE_DEFAULT);
         }
         t++;