Page MenuHomeFreeBSD

D46844.diff
No OneTemporary

D46844.diff

diff --git a/sys/dev/sound/fdt/audio_soc.c b/sys/dev/sound/fdt/audio_soc.c
--- a/sys/dev/sound/fdt/audio_soc.c
+++ b/sys/dev/sound/fdt/audio_soc.c
@@ -367,7 +367,7 @@
auxdev = OF_device_from_xref(aux_devs[i]);
if (auxdev == NULL)
device_printf(sc->dev, "warning: no driver attached to aux node\n");
- aux_node = (struct audio_soc_aux_node *)malloc(sizeof(*aux_node), M_DEVBUF, M_NOWAIT);
+ aux_node = malloc(sizeof(*aux_node), M_DEVBUF, M_NOWAIT);
if (aux_node == NULL) {
device_printf(sc->dev, "failed to allocate aux node struct\n");
return;
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
@@ -3033,8 +3033,7 @@
if (max < 1)
return;
- ctls = (struct hdaa_audio_ctl *)malloc(
- sizeof(*ctls) * max, M_HDAA, M_ZERO | M_NOWAIT);
+ ctls = malloc(sizeof(*ctls) * max, M_HDAA, M_ZERO | M_NOWAIT);
if (ctls == NULL) {
/* Blekh! */
@@ -3186,8 +3185,7 @@
if (max < 1)
return;
- as = (struct hdaa_audio_as *)malloc(
- sizeof(*as) * max, M_HDAA, M_ZERO | M_NOWAIT);
+ as = malloc(sizeof(*as) * max, M_HDAA, M_ZERO | M_NOWAIT);
if (as == NULL) {
/* Blekh! */
@@ -4077,8 +4075,7 @@
cnt += as[j].num_chans;
}
if (devinfo->num_chans == 0) {
- devinfo->chans = (struct hdaa_chan *)malloc(
- sizeof(struct hdaa_chan) * cnt,
+ devinfo->chans = malloc(sizeof(struct hdaa_chan) * cnt,
M_HDAA, M_ZERO | M_NOWAIT);
if (devinfo->chans == NULL) {
device_printf(devinfo->dev,
@@ -5490,10 +5487,8 @@
}
devinfo->num_devs =
max(ardev, apdev) + max(drdev, dpdev);
- devinfo->devs =
- (struct hdaa_pcm_devinfo *)malloc(
- devinfo->num_devs * sizeof(struct hdaa_pcm_devinfo),
- M_HDAA, M_ZERO | M_NOWAIT);
+ devinfo->devs = malloc(devinfo->num_devs *
+ sizeof(struct hdaa_pcm_devinfo), M_HDAA, M_ZERO | M_NOWAIT);
if (devinfo->devs == NULL) {
device_printf(devinfo->dev,
"Unable to allocate memory for devices\n");
@@ -6625,9 +6620,8 @@
);
if (devinfo->nodecnt > 0)
- devinfo->widget = (struct hdaa_widget *)malloc(
- sizeof(*(devinfo->widget)) * devinfo->nodecnt, M_HDAA,
- M_WAITOK | M_ZERO);
+ devinfo->widget = malloc(sizeof(*(devinfo->widget)) *
+ devinfo->nodecnt, M_HDAA, M_WAITOK | M_ZERO);
else
devinfo->widget = NULL;
diff --git a/sys/dev/sound/pci/maestro3.c b/sys/dev/sound/pci/maestro3.c
--- a/sys/dev/sound/pci/maestro3.c
+++ b/sys/dev/sound/pci/maestro3.c
@@ -1453,7 +1453,7 @@
/* Create the buffer for saving the card state during suspend */
len = sizeof(u_int16_t) * (REV_B_CODE_MEMORY_LENGTH +
REV_B_DATA_MEMORY_LENGTH);
- sc->savemem = (u_int16_t*)malloc(len, M_DEVBUF, M_WAITOK | M_ZERO);
+ sc->savemem = malloc(len, M_DEVBUF, M_WAITOK | M_ZERO);
return 0;
diff --git a/sys/dev/sound/pci/spicds.c b/sys/dev/sound/pci/spicds.c
--- a/sys/dev/sound/pci/spicds.c
+++ b/sys/dev/sound/pci/spicds.c
@@ -144,7 +144,7 @@
#if(0)
device_printf(dev, "spicds_create(dev, devinfo, %d, ctrl)\n", num);
#endif
- codec = (struct spicds_info *)malloc(sizeof *codec, M_SPICDS, M_NOWAIT);
+ codec = malloc(sizeof(*codec), M_SPICDS, M_NOWAIT);
if (codec == NULL)
return NULL;
diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c
--- a/sys/dev/sound/pcm/dsp.c
+++ b/sys/dev/sound/pcm/dsp.c
@@ -2493,7 +2493,7 @@
* syncgroup.
*/
if (group->id == 0) {
- sg = (struct pcmchan_syncgroup *)malloc(sizeof(*sg), M_DEVBUF, M_NOWAIT);
+ sg = malloc(sizeof(*sg), M_DEVBUF, M_NOWAIT);
if (sg != NULL) {
SLIST_INIT(&sg->members);
sg->id = alloc_unr(pcmsg_unrhdr);
@@ -2520,7 +2520,7 @@
* insert into syncgroup.
*/
if (group->mode & PCM_ENABLE_INPUT) {
- smrd = (struct pcmchan_syncmember *)malloc(sizeof(*smrd), M_DEVBUF, M_NOWAIT);
+ smrd = malloc(sizeof(*smrd), M_DEVBUF, M_NOWAIT);
if (smrd == NULL) {
ret = ENOMEM;
goto out;
@@ -2536,7 +2536,7 @@
}
if (group->mode & PCM_ENABLE_OUTPUT) {
- smwr = (struct pcmchan_syncmember *)malloc(sizeof(*smwr), M_DEVBUF, M_NOWAIT);
+ smwr = malloc(sizeof(*smwr), M_DEVBUF, M_NOWAIT);
if (smwr == NULL) {
ret = ENOMEM;
goto out;
diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c
--- a/sys/dev/sound/pcm/sndstat.c
+++ b/sys/dev/sound/pcm/sndstat.c
@@ -1109,7 +1109,7 @@
if (e == NULL)
goto fail;
ud->nameunit = strndup(line, e - line, M_DEVBUF);
- ud->devnode = (char *)malloc(e - line + 1, M_DEVBUF, M_WAITOK | M_ZERO);
+ ud->devnode = malloc(e - line + 1, M_DEVBUF, M_WAITOK | M_ZERO);
strlcat(ud->devnode, ud->nameunit, e - line + 1);
line = e + 1;

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 19, 4:16 PM (13 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14719547
Default Alt Text
D46844.diff (4 KB)

Event Timeline