git: 2ef1f61df2d5 - main - cfi: Use device_set_descf()

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

URL: https://cgit.FreeBSD.org/src/commit/?id=2ef1f61df2d5961ffff1205d4800e46efadbf5ba

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

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

diff --git a/sys/dev/cfi/cfi_core.c b/sys/dev/cfi/cfi_core.c
index 4e137140372c..9554a710d8f2 100644
--- a/sys/dev/cfi/cfi_core.c
+++ b/sys/dev/cfi/cfi_core.c
@@ -194,7 +194,6 @@ cfi_fmtsize(uint32_t sz)
 int
 cfi_probe(device_t dev)
 {
-	char desc[80];
 	struct cfi_softc *sc;
 	char *vend_str;
 	int error;
@@ -279,9 +278,7 @@ cfi_probe(device_t dev)
 	if (error)
 		goto out;
 
-	snprintf(desc, sizeof(desc), "%s - %s", vend_str,
-	    cfi_fmtsize(sc->sc_size));
-	device_set_desc_copy(dev, desc);
+	device_set_descf(dev, "%s - %s", vend_str, cfi_fmtsize(sc->sc_size));
 
  out:
 	bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_rid, sc->sc_res);