aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJesper Juhl <jesper.juhl@gmail.com>2006-03-28 04:56:54 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-28 12:16:09 -0500
commit4fa95ef639830ccf0ca1ad42ee9bed87ef642f32 (patch)
tree5b7357fc9f89b0d94e6a969414de2e8499cfc256 /sound
parent7f927fcc2fd1575d01efb4b76665975007945690 (diff)
[PATCH] sound: Remove unneeded kmalloc() return value casts
Get rid of unnessesary casts of kmalloc() return value in sound/ Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/core/rawmidi.c6
-rw-r--r--sound/oss/dmasound/dmasound_awacs.c2
-rw-r--r--sound/oss/emu10k1/midi.c9
-rw-r--r--sound/oss/sh_dac_audio.c2
4 files changed, 12 insertions, 7 deletions
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index 6b7a36774298..87b47c9564f7 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -631,7 +631,8 @@ int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream,
631 return -EINVAL; 631 return -EINVAL;
632 } 632 }
633 if (params->buffer_size != runtime->buffer_size) { 633 if (params->buffer_size != runtime->buffer_size) {
634 if ((newbuf = (char *) kmalloc(params->buffer_size, GFP_KERNEL)) == NULL) 634 newbuf = kmalloc(params->buffer_size, GFP_KERNEL);
635 if (!newbuf)
635 return -ENOMEM; 636 return -ENOMEM;
636 kfree(runtime->buffer); 637 kfree(runtime->buffer);
637 runtime->buffer = newbuf; 638 runtime->buffer = newbuf;
@@ -657,7 +658,8 @@ int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream,
657 return -EINVAL; 658 return -EINVAL;
658 } 659 }
659 if (params->buffer_size != runtime->buffer_size) { 660 if (params->buffer_size != runtime->buffer_size) {
660 if ((newbuf = (char *) kmalloc(params->buffer_size, GFP_KERNEL)) == NULL) 661 newbuf = kmalloc(params->buffer_size, GFP_KERNEL);
662 if (!newbuf)
661 return -ENOMEM; 663 return -ENOMEM;
662 kfree(runtime->buffer); 664 kfree(runtime->buffer);
663 runtime->buffer = newbuf; 665 runtime->buffer = newbuf;
diff --git a/sound/oss/dmasound/dmasound_awacs.c b/sound/oss/dmasound/dmasound_awacs.c
index 6ba8d6f45fe8..3bbc8105e9f1 100644
--- a/sound/oss/dmasound/dmasound_awacs.c
+++ b/sound/oss/dmasound/dmasound_awacs.c
@@ -2798,7 +2798,7 @@ __init setup_beep(void)
2798 DBDMA_ALIGN(beep_dbdma_cmd_space); 2798 DBDMA_ALIGN(beep_dbdma_cmd_space);
2799 /* set up emergency dbdma cmd */ 2799 /* set up emergency dbdma cmd */
2800 emergency_dbdma_cmd = beep_dbdma_cmd+1 ; 2800 emergency_dbdma_cmd = beep_dbdma_cmd+1 ;
2801 beep_buf = (short *) kmalloc(BEEP_BUFLEN * 4, GFP_KERNEL); 2801 beep_buf = kmalloc(BEEP_BUFLEN * 4, GFP_KERNEL);
2802 if (beep_buf == NULL) { 2802 if (beep_buf == NULL) {
2803 printk(KERN_ERR "dmasound_pmac: no memory for beep buffer\n"); 2803 printk(KERN_ERR "dmasound_pmac: no memory for beep buffer\n");
2804 kfree(beep_dbdma_cmd_space) ; 2804 kfree(beep_dbdma_cmd_space) ;
diff --git a/sound/oss/emu10k1/midi.c b/sound/oss/emu10k1/midi.c
index 959a96794dba..25ae8e4a488d 100644
--- a/sound/oss/emu10k1/midi.c
+++ b/sound/oss/emu10k1/midi.c
@@ -65,7 +65,8 @@ static int midiin_add_buffer(struct emu10k1_mididevice *midi_dev, struct midi_hd
65 65
66 init_midi_hdr(midihdr); 66 init_midi_hdr(midihdr);
67 67
68 if ((midihdr->data = (u8 *) kmalloc(MIDIIN_BUFLEN, GFP_KERNEL)) == NULL) { 68 midihdr->data = kmalloc(MIDIIN_BUFLEN, GFP_KERNEL);
69 if (!midihdr->data) {
69 ERROR(); 70 ERROR();
70 kfree(midihdr); 71 kfree(midihdr);
71 return -1; 72 return -1;
@@ -334,7 +335,8 @@ static ssize_t emu10k1_midi_write(struct file *file, const char __user *buffer,
334 midihdr->bytesrecorded = 0; 335 midihdr->bytesrecorded = 0;
335 midihdr->flags = 0; 336 midihdr->flags = 0;
336 337
337 if ((midihdr->data = (u8 *) kmalloc(count, GFP_KERNEL)) == NULL) { 338 midihdr->data = kmalloc(count, GFP_KERNEL);
339 if (!midihdr->data) {
338 ERROR(); 340 ERROR();
339 kfree(midihdr); 341 kfree(midihdr);
340 return -EINVAL; 342 return -EINVAL;
@@ -545,7 +547,8 @@ int emu10k1_seq_midi_out(int dev, unsigned char midi_byte)
545 midihdr->bytesrecorded = 0; 547 midihdr->bytesrecorded = 0;
546 midihdr->flags = 0; 548 midihdr->flags = 0;
547 549
548 if ((midihdr->data = (u8 *) kmalloc(1, GFP_KERNEL)) == NULL) { 550 midihdr->data = kmalloc(1, GFP_KERNEL);
551 if (!midihdr->data) {
549 ERROR(); 552 ERROR();
550 kfree(midihdr); 553 kfree(midihdr);
551 return -EINVAL; 554 return -EINVAL;
diff --git a/sound/oss/sh_dac_audio.c b/sound/oss/sh_dac_audio.c
index 8a9917c919c2..3f7427cd195a 100644
--- a/sound/oss/sh_dac_audio.c
+++ b/sound/oss/sh_dac_audio.c
@@ -289,7 +289,7 @@ static int __init dac_audio_init(void)
289 289
290 in_use = 0; 290 in_use = 0;
291 291
292 data_buffer = (char *)kmalloc(BUFFER_SIZE, GFP_KERNEL); 292 data_buffer = kmalloc(BUFFER_SIZE, GFP_KERNEL);
293 if (data_buffer == NULL) 293 if (data_buffer == NULL)
294 return -ENOMEM; 294 return -ENOMEM;
295 295