git: c5fe4fcda4fc - stable/14 - cxgbe: Use device_set_descf()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 09 Jun 2024 14:12:05 UTC
The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c5fe4fcda4fc4fc8274e8f8b32851d0ecec5dada commit c5fe4fcda4fc4fc8274e8f8b32851d0ecec5dada Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2024-02-04 23:38:04 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-06-09 13:37:51 +0000 cxgbe: Use device_set_descf() No functional change intended. MFC after: 1 week (cherry picked from commit a1b84451159fbad069ccaa4b5197a3fde7eae902) --- sys/dev/cxgbe/t4_main.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 6cb434295b42..f79bcfdabacf 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -2527,11 +2527,9 @@ reset_adapter_task(void *arg, int pending) static int cxgbe_probe(device_t dev) { - char buf[128]; struct port_info *pi = device_get_softc(dev); - snprintf(buf, sizeof(buf), "port %d", pi->port_id); - device_set_desc_copy(dev, buf); + device_set_descf(dev, "port %d", pi->port_id); return (BUS_PROBE_DEFAULT); } @@ -3504,12 +3502,10 @@ done: static int vcxgbe_probe(device_t dev) { - char buf[128]; struct vi_info *vi = device_get_softc(dev); - snprintf(buf, sizeof(buf), "port %d vi %td", vi->pi->port_id, + device_set_descf(dev, "port %d vi %td", vi->pi->port_id, vi - vi->pi->vi); - device_set_desc_copy(dev, buf); return (BUS_PROBE_DEFAULT); } @@ -5760,12 +5756,9 @@ set_params__post_init(struct adapter *sc) static void t4_set_desc(struct adapter *sc) { - char buf[128]; struct adapter_params *p = &sc->params; - snprintf(buf, sizeof(buf), "Chelsio %s", p->vpd.id); - - device_set_desc_copy(sc->dev, buf); + device_set_descf(sc->dev, "Chelsio %s", p->vpd.id); } static inline void