aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/seq
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2011-02-14 05:00:47 -0500
committerTakashi Iwai <tiwai@suse.de>2011-02-14 11:10:11 -0500
commitfea952e5cc23ea94b4677ca20774cdc3cea014e2 (patch)
tree0a5fac1e830e7f5eba9d52431088b1481c86eeb8 /sound/core/seq
parent88b27fdac814c4926175ff0e740f98343ad77491 (diff)
ALSA: core: sparse cleanups
Change the core code where sparse complains. In most cases, this means just adding annotations to confirm that we indeed want to do the dirty things we're doing. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/seq')
-rw-r--r--sound/core/seq/seq_clientmgr.c7
-rw-r--r--sound/core/seq/seq_memory.c6
-rw-r--r--sound/core/seq/seq_memory.h4
3 files changed, 9 insertions, 8 deletions
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
index 99a485f1364..f2436d33fbf 100644
--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -1052,7 +1052,7 @@ static ssize_t snd_seq_write(struct file *file, const char __user *buf,
1052 } else { 1052 } else {
1053#ifdef CONFIG_COMPAT 1053#ifdef CONFIG_COMPAT
1054 if (client->convert32 && snd_seq_ev_is_varusr(&event)) { 1054 if (client->convert32 && snd_seq_ev_is_varusr(&event)) {
1055 void *ptr = compat_ptr(event.data.raw32.d[1]); 1055 void *ptr = (void __force *)compat_ptr(event.data.raw32.d[1]);
1056 event.data.ext.ptr = ptr; 1056 event.data.ext.ptr = ptr;
1057 } 1057 }
1058#endif 1058#endif
@@ -2407,7 +2407,7 @@ int snd_seq_kernel_client_ctl(int clientid, unsigned int cmd, void *arg)
2407 if (client == NULL) 2407 if (client == NULL)
2408 return -ENXIO; 2408 return -ENXIO;
2409 fs = snd_enter_user(); 2409 fs = snd_enter_user();
2410 result = snd_seq_do_ioctl(client, cmd, (void __user *)arg); 2410 result = snd_seq_do_ioctl(client, cmd, (void __force __user *)arg);
2411 snd_leave_user(fs); 2411 snd_leave_user(fs);
2412 return result; 2412 return result;
2413} 2413}
@@ -2497,9 +2497,6 @@ static void snd_seq_info_dump_ports(struct snd_info_buffer *buffer,
2497} 2497}
2498 2498
2499 2499
2500void snd_seq_info_pool(struct snd_info_buffer *buffer,
2501 struct snd_seq_pool *pool, char *space);
2502
2503/* exported to seq_info.c */ 2500/* exported to seq_info.c */
2504void snd_seq_info_clients_read(struct snd_info_entry *entry, 2501void snd_seq_info_clients_read(struct snd_info_entry *entry,
2505 struct snd_info_buffer *buffer) 2502 struct snd_info_buffer *buffer)
diff --git a/sound/core/seq/seq_memory.c b/sound/core/seq/seq_memory.c
index 7fb55436287..7f50c143767 100644
--- a/sound/core/seq/seq_memory.c
+++ b/sound/core/seq/seq_memory.c
@@ -86,7 +86,7 @@ int snd_seq_dump_var_event(const struct snd_seq_event *event,
86 86
87 if (event->data.ext.len & SNDRV_SEQ_EXT_USRPTR) { 87 if (event->data.ext.len & SNDRV_SEQ_EXT_USRPTR) {
88 char buf[32]; 88 char buf[32];
89 char __user *curptr = (char __user *)event->data.ext.ptr; 89 char __user *curptr = (char __force __user *)event->data.ext.ptr;
90 while (len > 0) { 90 while (len > 0) {
91 int size = sizeof(buf); 91 int size = sizeof(buf);
92 if (len < size) 92 if (len < size)
@@ -157,7 +157,7 @@ int snd_seq_expand_var_event(const struct snd_seq_event *event, int count, char
157 if (event->data.ext.len & SNDRV_SEQ_EXT_USRPTR) { 157 if (event->data.ext.len & SNDRV_SEQ_EXT_USRPTR) {
158 if (! in_kernel) 158 if (! in_kernel)
159 return -EINVAL; 159 return -EINVAL;
160 if (copy_from_user(buf, (void __user *)event->data.ext.ptr, len)) 160 if (copy_from_user(buf, (void __force __user *)event->data.ext.ptr, len))
161 return -EFAULT; 161 return -EFAULT;
162 return newlen; 162 return newlen;
163 } 163 }
@@ -343,7 +343,7 @@ int snd_seq_event_dup(struct snd_seq_pool *pool, struct snd_seq_event *event,
343 tmp->event = src->event; 343 tmp->event = src->event;
344 src = src->next; 344 src = src->next;
345 } else if (is_usrptr) { 345 } else if (is_usrptr) {
346 if (copy_from_user(&tmp->event, (char __user *)buf, size)) { 346 if (copy_from_user(&tmp->event, (char __force __user *)buf, size)) {
347 err = -EFAULT; 347 err = -EFAULT;
348 goto __error; 348 goto __error;
349 } 349 }
diff --git a/sound/core/seq/seq_memory.h b/sound/core/seq/seq_memory.h
index 63e91431a29..4a2ec779b8a 100644
--- a/sound/core/seq/seq_memory.h
+++ b/sound/core/seq/seq_memory.h
@@ -24,6 +24,8 @@
24#include <sound/seq_kernel.h> 24#include <sound/seq_kernel.h>
25#include <linux/poll.h> 25#include <linux/poll.h>
26 26
27struct snd_info_buffer;
28
27/* container for sequencer event (internal use) */ 29/* container for sequencer event (internal use) */
28struct snd_seq_event_cell { 30struct snd_seq_event_cell {
29 struct snd_seq_event event; 31 struct snd_seq_event event;
@@ -99,5 +101,7 @@ void snd_sequencer_memory_done(void);
99/* polling */ 101/* polling */
100int snd_seq_pool_poll_wait(struct snd_seq_pool *pool, struct file *file, poll_table *wait); 102int snd_seq_pool_poll_wait(struct snd_seq_pool *pool, struct file *file, poll_table *wait);
101 103
104void snd_seq_info_pool(struct snd_info_buffer *buffer,
105 struct snd_seq_pool *pool, char *space);
102 106
103#endif 107#endif