[PATCH] sound: Remove unneeded kmalloc() return value casts
authorJesper Juhl <jesper.juhl@gmail.com>
Tue, 28 Mar 2006 09:56:54 +0000 (01:56 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 28 Mar 2006 17:16:09 +0000 (09:16 -0800)
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>
sound/core/rawmidi.c
sound/oss/dmasound/dmasound_awacs.c
sound/oss/emu10k1/midi.c
sound/oss/sh_dac_audio.c

index 6b7a3677429891c041fd77a6108dbce0b614c87f..87b47c9564f78029ad6ceaaaf0e8b700fdcbb5d5 100644 (file)
@@ -631,7 +631,8 @@ int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream,
                return -EINVAL;
        }
        if (params->buffer_size != runtime->buffer_size) {
-               if ((newbuf = (char *) kmalloc(params->buffer_size, GFP_KERNEL)) == NULL)
+               newbuf = kmalloc(params->buffer_size, GFP_KERNEL);
+               if (!newbuf)
                        return -ENOMEM;
                kfree(runtime->buffer);
                runtime->buffer = newbuf;
@@ -657,7 +658,8 @@ int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream,
                return -EINVAL;
        }
        if (params->buffer_size != runtime->buffer_size) {
-               if ((newbuf = (char *) kmalloc(params->buffer_size, GFP_KERNEL)) == NULL)
+               newbuf = kmalloc(params->buffer_size, GFP_KERNEL);
+               if (!newbuf)
                        return -ENOMEM;
                kfree(runtime->buffer);
                runtime->buffer = newbuf;
index 6ba8d6f45fe848ecbcf288a46f3410fc51cd88ba..3bbc8105e9f10dfedcf362fc86c3361609590d90 100644 (file)
@@ -2798,7 +2798,7 @@ __init setup_beep(void)
                        DBDMA_ALIGN(beep_dbdma_cmd_space);
        /* set up emergency dbdma cmd */
        emergency_dbdma_cmd = beep_dbdma_cmd+1 ;
-       beep_buf = (short *) kmalloc(BEEP_BUFLEN * 4, GFP_KERNEL);
+       beep_buf = kmalloc(BEEP_BUFLEN * 4, GFP_KERNEL);
        if (beep_buf == NULL) {
                printk(KERN_ERR "dmasound_pmac: no memory for beep buffer\n");
                kfree(beep_dbdma_cmd_space) ;
index 959a96794dbad0c88bcdcdca8fb79795afda8f46..25ae8e4a488db955db707f25c4dc876ef94f3d5b 100644 (file)
@@ -65,7 +65,8 @@ static int midiin_add_buffer(struct emu10k1_mididevice *midi_dev, struct midi_hd
 
        init_midi_hdr(midihdr);
 
-       if ((midihdr->data = (u8 *) kmalloc(MIDIIN_BUFLEN, GFP_KERNEL)) == NULL) {
+       midihdr->data = kmalloc(MIDIIN_BUFLEN, GFP_KERNEL);
+       if (!midihdr->data) {
                ERROR();
                kfree(midihdr);
                return -1;
@@ -334,7 +335,8 @@ static ssize_t emu10k1_midi_write(struct file *file, const char __user *buffer,
        midihdr->bytesrecorded = 0;
        midihdr->flags = 0;
 
-       if ((midihdr->data = (u8 *) kmalloc(count, GFP_KERNEL)) == NULL) {
+       midihdr->data = kmalloc(count, GFP_KERNEL);
+       if (!midihdr->data) {
                ERROR();
                kfree(midihdr);
                return -EINVAL;
@@ -545,7 +547,8 @@ int emu10k1_seq_midi_out(int dev, unsigned char midi_byte)
        midihdr->bytesrecorded = 0;
        midihdr->flags = 0;
 
-       if ((midihdr->data = (u8 *) kmalloc(1, GFP_KERNEL)) == NULL) {
+       midihdr->data = kmalloc(1, GFP_KERNEL);
+       if (!midihdr->data) {
                ERROR();
                kfree(midihdr);
                return -EINVAL;
index 8a9917c919c2e60cc00b06908f61d855bb184f3c..3f7427cd195a03358ca5fc136d24690177c38ae1 100644 (file)
@@ -289,7 +289,7 @@ static int __init dac_audio_init(void)
 
        in_use = 0;
 
-       data_buffer = (char *)kmalloc(BUFFER_SIZE, GFP_KERNEL);
+       data_buffer = kmalloc(BUFFER_SIZE, GFP_KERNEL);
        if (data_buffer == NULL)
                return -ENOMEM;