projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] remove many unneeded #includes of sched.h
[powerpc.git]
/
sound
/
oss
/
emu10k1
/
midi.c
diff --git
a/sound/oss/emu10k1/midi.c
b/sound/oss/emu10k1/midi.c
index
959a967
..
df1e990
100644
(file)
--- a/
sound/oss/emu10k1/midi.c
+++ b/
sound/oss/emu10k1/midi.c
@@
-45,7
+45,7
@@
#include "../sound_config.h"
#endif
#include "../sound_config.h"
#endif
-static DEFINE_SPINLOCK(midi_spinlock
__attribute((unused))
);
+static DEFINE_SPINLOCK(midi_spinlock);
static void init_midi_hdr(struct midi_hdr *midihdr)
{
static void init_midi_hdr(struct midi_hdr *midihdr)
{
@@
-58,14
+58,15
@@
static int midiin_add_buffer(struct emu10k1_mididevice *midi_dev, struct midi_hd
{
struct midi_hdr *midihdr;
{
struct midi_hdr *midihdr;
- if ((midihdr =
(struct midi_hdr *)
kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL) {
+ if ((midihdr = kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL) {
ERROR();
return -EINVAL;
}
init_midi_hdr(midihdr);
ERROR();
return -EINVAL;
}
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;
ERROR();
kfree(midihdr);
return -1;
@@
-127,7
+128,7
@@
match:
mutex_lock(&card->open_sem);
}
mutex_lock(&card->open_sem);
}
- if ((midi_dev =
(struct emu10k1_mididevice *)
kmalloc(sizeof(*midi_dev), GFP_KERNEL)) == NULL)
+ if ((midi_dev = kmalloc(sizeof(*midi_dev), GFP_KERNEL)) == NULL)
return -EINVAL;
midi_dev->card = card;
return -EINVAL;
midi_dev->card = card;
@@
-327,14
+328,15
@@
static ssize_t emu10k1_midi_write(struct file *file, const char __user *buffer,
if (!access_ok(VERIFY_READ, buffer, count))
return -EFAULT;
if (!access_ok(VERIFY_READ, buffer, count))
return -EFAULT;
- if ((midihdr =
(struct midi_hdr *)
kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL)
+ if ((midihdr = kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL)
return -EINVAL;
midihdr->bufferlength = count;
midihdr->bytesrecorded = 0;
midihdr->flags = 0;
return -EINVAL;
midihdr->bufferlength = count;
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;
ERROR();
kfree(midihdr);
return -EINVAL;
@@
-456,7
+458,7
@@
int emu10k1_midi_callback(unsigned long msg, unsigned long refdata, unsigned lon
}
/* MIDI file operations */
}
/* MIDI file operations */
-struct file_operations emu10k1_midi_fops = {
+
const
struct file_operations emu10k1_midi_fops = {
.owner = THIS_MODULE,
.read = emu10k1_midi_read,
.write = emu10k1_midi_write,
.owner = THIS_MODULE,
.read = emu10k1_midi_read,
.write = emu10k1_midi_write,
@@
-488,7
+490,7
@@
int emu10k1_seq_midi_open(int dev, int mode,
DPF(2, "emu10k1_seq_midi_open()\n");
DPF(2, "emu10k1_seq_midi_open()\n");
- if ((midi_dev =
(struct emu10k1_mididevice *)
kmalloc(sizeof(*midi_dev), GFP_KERNEL)) == NULL)
+ if ((midi_dev = kmalloc(sizeof(*midi_dev), GFP_KERNEL)) == NULL)
return -EINVAL;
midi_dev->card = card;
return -EINVAL;
midi_dev->card = card;
@@
-538,14
+540,15
@@
int emu10k1_seq_midi_out(int dev, unsigned char midi_byte)
card = midi_devs[dev]->devc;
card = midi_devs[dev]->devc;
- if ((midihdr =
(struct midi_hdr *)
kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL)
+ if ((midihdr = kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL)
return -EINVAL;
midihdr->bufferlength = 1;
midihdr->bytesrecorded = 0;
midihdr->flags = 0;
return -EINVAL;
midihdr->bufferlength = 1;
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;
ERROR();
kfree(midihdr);
return -EINVAL;