diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-09-21 22:30:42 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-09-21 22:30:42 -0400 |
commit | 08217637fe8a0ba24e1bfc893569f9be4d836c6a (patch) | |
tree | aecd53ca7952b59d93f066161b677926e813a550 /sound/core/rawmidi.c | |
parent | 793b883ed12a6ae6e2901ddb5e038b77d6f0c0ac (diff) | |
parent | efb0372bbaf5b829ff8c39db372779928af542a7 (diff) |
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'sound/core/rawmidi.c')
-rw-r--r-- | sound/core/rawmidi.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index edba4118271c..7c20eafecb8a 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c | |||
@@ -101,7 +101,7 @@ static int snd_rawmidi_runtime_create(snd_rawmidi_substream_t * substream) | |||
101 | { | 101 | { |
102 | snd_rawmidi_runtime_t *runtime; | 102 | snd_rawmidi_runtime_t *runtime; |
103 | 103 | ||
104 | if ((runtime = kcalloc(1, sizeof(*runtime), GFP_KERNEL)) == NULL) | 104 | if ((runtime = kzalloc(sizeof(*runtime), GFP_KERNEL)) == NULL) |
105 | return -ENOMEM; | 105 | return -ENOMEM; |
106 | spin_lock_init(&runtime->lock); | 106 | spin_lock_init(&runtime->lock); |
107 | init_waitqueue_head(&runtime->sleep); | 107 | init_waitqueue_head(&runtime->sleep); |
@@ -984,7 +984,9 @@ static ssize_t snd_rawmidi_read(struct file *file, char __user *buf, size_t coun | |||
984 | spin_lock_irq(&runtime->lock); | 984 | spin_lock_irq(&runtime->lock); |
985 | } | 985 | } |
986 | spin_unlock_irq(&runtime->lock); | 986 | spin_unlock_irq(&runtime->lock); |
987 | count1 = snd_rawmidi_kernel_read1(substream, (unsigned char *)buf, count, 0); | 987 | count1 = snd_rawmidi_kernel_read1(substream, |
988 | (unsigned char __force *)buf, | ||
989 | count, 0); | ||
988 | if (count1 < 0) | 990 | if (count1 < 0) |
989 | return result > 0 ? result : count1; | 991 | return result > 0 ? result : count1; |
990 | result += count1; | 992 | result += count1; |
@@ -1107,7 +1109,7 @@ int snd_rawmidi_transmit_ack(snd_rawmidi_substream_t * substream, int count) | |||
1107 | /** | 1109 | /** |
1108 | * snd_rawmidi_transmit - copy from the buffer to the device | 1110 | * snd_rawmidi_transmit - copy from the buffer to the device |
1109 | * @substream: the rawmidi substream | 1111 | * @substream: the rawmidi substream |
1110 | * @buf: the buffer pointer | 1112 | * @buffer: the buffer pointer |
1111 | * @count: the data size to transfer | 1113 | * @count: the data size to transfer |
1112 | * | 1114 | * |
1113 | * Copies data from the buffer to the device and advances the pointer. | 1115 | * Copies data from the buffer to the device and advances the pointer. |
@@ -1213,7 +1215,9 @@ static ssize_t snd_rawmidi_write(struct file *file, const char __user *buf, size | |||
1213 | spin_lock_irq(&runtime->lock); | 1215 | spin_lock_irq(&runtime->lock); |
1214 | } | 1216 | } |
1215 | spin_unlock_irq(&runtime->lock); | 1217 | spin_unlock_irq(&runtime->lock); |
1216 | count1 = snd_rawmidi_kernel_write1(substream, (unsigned char *)buf, count, 0); | 1218 | count1 = snd_rawmidi_kernel_write1(substream, |
1219 | (unsigned char __force *)buf, | ||
1220 | count, 0); | ||
1217 | if (count1 < 0) | 1221 | if (count1 < 0) |
1218 | return result > 0 ? result : count1; | 1222 | return result > 0 ? result : count1; |
1219 | result += count1; | 1223 | result += count1; |
@@ -1370,7 +1374,7 @@ static int snd_rawmidi_alloc_substreams(snd_rawmidi_t *rmidi, | |||
1370 | 1374 | ||
1371 | INIT_LIST_HEAD(&stream->substreams); | 1375 | INIT_LIST_HEAD(&stream->substreams); |
1372 | for (idx = 0; idx < count; idx++) { | 1376 | for (idx = 0; idx < count; idx++) { |
1373 | substream = kcalloc(1, sizeof(*substream), GFP_KERNEL); | 1377 | substream = kzalloc(sizeof(*substream), GFP_KERNEL); |
1374 | if (substream == NULL) | 1378 | if (substream == NULL) |
1375 | return -ENOMEM; | 1379 | return -ENOMEM; |
1376 | substream->stream = direction; | 1380 | substream->stream = direction; |
@@ -1413,7 +1417,7 @@ int snd_rawmidi_new(snd_card_t * card, char *id, int device, | |||
1413 | snd_assert(rrawmidi != NULL, return -EINVAL); | 1417 | snd_assert(rrawmidi != NULL, return -EINVAL); |
1414 | *rrawmidi = NULL; | 1418 | *rrawmidi = NULL; |
1415 | snd_assert(card != NULL, return -ENXIO); | 1419 | snd_assert(card != NULL, return -ENXIO); |
1416 | rmidi = kcalloc(1, sizeof(*rmidi), GFP_KERNEL); | 1420 | rmidi = kzalloc(sizeof(*rmidi), GFP_KERNEL); |
1417 | if (rmidi == NULL) | 1421 | if (rmidi == NULL) |
1418 | return -ENOMEM; | 1422 | return -ENOMEM; |
1419 | rmidi->card = card; | 1423 | rmidi->card = card; |