[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>
This commit is contained in:
Jesper Juhl
2006-03-28 01:56:54 -08:00
committed by Linus Torvalds
parent 7f927fcc2f
commit 4fa95ef639
4 changed files with 12 additions and 7 deletions

View 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;