Page MenuHomeFreeBSD

D43467.diff
No OneTemporary

D43467.diff

diff --git a/sys/dev/sound/pci/emu10kx-pcm.c b/sys/dev/sound/pci/emu10kx-pcm.c
--- a/sys/dev/sound/pci/emu10kx-pcm.c
+++ b/sys/dev/sound/pci/emu10kx-pcm.c
@@ -1298,7 +1298,6 @@
{
uintptr_t func, route;
const char *rt;
- char buffer[255];
BUS_READ_IVAR(device_get_parent(dev), dev, EMU_VAR_FUNC, &func);
@@ -1328,8 +1327,7 @@
break;
}
- snprintf(buffer, 255, "EMU10Kx DSP %s PCM interface", rt);
- device_set_desc_copy(dev, buffer);
+ device_set_descf(dev, "EMU10Kx DSP %s PCM interface", rt);
return (0);
}
diff --git a/sys/dev/sound/pci/emu10kx.c b/sys/dev/sound/pci/emu10kx.c
--- a/sys/dev/sound/pci/emu10kx.c
+++ b/sys/dev/sound/pci/emu10kx.c
@@ -2985,7 +2985,6 @@
static int
emu_pci_probe(device_t dev)
{
- struct sbuf *s;
unsigned int thiscard = 0;
uint16_t vendor;
@@ -2997,15 +2996,8 @@
if (thiscard == 0)
return (ENXIO);
- s = sbuf_new(NULL, NULL, 4096, 0);
- if (s == NULL)
- return (ENOMEM);
- sbuf_printf(s, "Creative %s [%s]", emu_cards[thiscard].desc, emu_cards[thiscard].SBcode);
- sbuf_finish(s);
-
- device_set_desc_copy(dev, sbuf_data(s));
-
- sbuf_delete(s);
+ device_set_descf(dev, "Creative %s [%s]",
+ emu_cards[thiscard].desc, emu_cards[thiscard].SBcode);
return (BUS_PROBE_DEFAULT);
}
diff --git a/sys/dev/sound/pci/hda/hdaa.c b/sys/dev/sound/pci/hda/hdaa.c
--- a/sys/dev/sound/pci/hda/hdaa.c
+++ b/sys/dev/sound/pci/hda/hdaa.c
@@ -6577,14 +6577,12 @@
hdaa_probe(device_t dev)
{
const char *pdesc;
- char buf[128];
if (hda_get_node_type(dev) != HDA_PARAM_FCT_GRP_TYPE_NODE_TYPE_AUDIO)
return (ENXIO);
pdesc = device_get_desc(device_get_parent(dev));
- snprintf(buf, sizeof(buf), "%.*s Audio Function Group",
+ device_set_descf(dev, "%.*s Audio Function Group",
(int)(strlen(pdesc) - 10), pdesc);
- device_set_desc_copy(dev, buf);
return (BUS_PROBE_DEFAULT);
}
@@ -6939,7 +6937,6 @@
struct hdaa_devinfo *devinfo = pdevinfo->devinfo;
const char *pdesc;
char chans1[8], chans2[8];
- char buf[128];
int loc1, loc2, t1, t2;
if (pdevinfo->playas >= 0)
@@ -6984,7 +6981,7 @@
if (pdevinfo->digital)
t1 = -2;
pdesc = device_get_desc(device_get_parent(dev));
- snprintf(buf, sizeof(buf), "%.*s (%s%s%s%s%s%s%s%s%s)",
+ device_set_descf(dev, "%.*s (%s%s%s%s%s%s%s%s%s)",
(int)(strlen(pdesc) - 21), pdesc,
loc1 >= 0 ? HDA_LOCS[loc1] : "", loc1 >= 0 ? " " : "",
(pdevinfo->digital == 0x7)?"HDMI/DP":
@@ -6994,7 +6991,6 @@
chans1[0] ? " " : "", chans1,
chans2[0] ? "/" : "", chans2,
t1 >= 0 ? " " : "", t1 >= 0 ? HDA_DEVS[t1] : "");
- device_set_desc_copy(dev, buf);
return (BUS_PROBE_SPECIFIC);
}
diff --git a/sys/dev/sound/pci/hda/hdac.c b/sys/dev/sound/pci/hda/hdac.c
--- a/sys/dev/sound/pci/hda/hdac.c
+++ b/sys/dev/sound/pci/hda/hdac.c
@@ -1101,10 +1101,8 @@
snprintf(desc, sizeof(desc), "Generic (0x%08x)", model);
result = BUS_PROBE_GENERIC;
}
- if (result != ENXIO) {
- strlcat(desc, " HDA Controller", sizeof(desc));
- device_set_desc_copy(dev, desc);
- }
+ if (result != ENXIO)
+ device_set_descf(dev, "%s HDA Controller", desc);
return (result);
}
diff --git a/sys/dev/sound/pci/hda/hdacc.c b/sys/dev/sound/pci/hda/hdacc.c
--- a/sys/dev/sound/pci/hda/hdacc.c
+++ b/sys/dev/sound/pci/hda/hdacc.c
@@ -472,8 +472,7 @@
hdacc_codecs[i].name, hda_get_device_id(dev));
} else
snprintf(buf, sizeof(buf), "Generic (0x%04x)", id);
- strlcat(buf, " HDA CODEC", sizeof(buf));
- device_set_desc_copy(dev, buf);
+ device_set_descf(dev, "%s HDA CODEC", buf);
return (BUS_PROBE_DEFAULT);
}
diff --git a/sys/dev/sound/pci/hdspe-pcm.c b/sys/dev/sound/pci/hdspe-pcm.c
--- a/sys/dev/sound/pci/hdspe-pcm.c
+++ b/sys/dev/sound/pci/hdspe-pcm.c
@@ -1000,23 +1000,20 @@
{
char status[SND_STATUSLEN];
struct sc_pcminfo *scp;
- char desc[64];
+ const char *buf;
int err;
int play, rec;
scp = device_get_ivars(dev);
scp->ih = &hdspe_pcm_intr;
- bzero(desc, sizeof(desc));
if (scp->hc->ports & HDSPE_CHAN_AIO_ALL)
- snprintf(desc, sizeof(desc), "HDSPe AIO [%s]",
- scp->hc->descr);
+ buf = "AIO";
else if (scp->hc->ports & HDSPE_CHAN_RAY_ALL)
- snprintf(desc, sizeof(desc), "HDSPe RayDAT [%s]",
- scp->hc->descr);
+ buf = "RayDAT";
else
- snprintf(desc, sizeof(desc), "HDSPe ? [%s]", scp->hc->descr);
- device_set_desc_copy(dev, desc);
+ buf = "?";
+ device_set_descf(dev, "HDSPe %s [%s]", buf, scp->hc->descr);
/*
* We don't register interrupt handler with snd_setup_intr
diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c
--- a/sys/dev/sound/usb/uaudio.c
+++ b/sys/dev/sound/usb/uaudio.c
@@ -1171,7 +1171,7 @@
{
struct uaudio_softc *sc = device_get_softc(device_get_parent(dev));
unsigned i = uaudio_get_child_index_by_dev(sc, dev);
- char status[SND_STATUSLEN], desc[128];
+ char status[SND_STATUSLEN];
uaudio_mixer_init(sc, i);
@@ -1199,10 +1199,9 @@
mixer_hwvol_init(dev);
- snprintf(desc, sizeof(desc), "%s %s",
+ device_set_descf(dev, "%s %s",
usb_get_manufacturer(sc->sc_udev),
usb_get_product(sc->sc_udev));
- device_set_desc_copy(dev, desc);
snprintf(status, sizeof(status), "on %s",
device_get_nameunit(device_get_parent(dev)));

File Metadata

Mime Type
text/plain
Expires
Sun, Sep 29, 1:05 PM (17 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
13103870
Default Alt Text
D43467.diff (5 KB)

Event Timeline