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;
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;
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) ;
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;
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;
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;
in_use = 0;
- data_buffer = (char *)kmalloc(BUFFER_SIZE, GFP_KERNEL);
+ data_buffer = kmalloc(BUFFER_SIZE, GFP_KERNEL);
if (data_buffer == NULL)
return -ENOMEM;