diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2005-09-05 04:35:20 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-09-12 04:41:16 -0400 |
commit | 4d23359b7ec8b03da2154df935af7d625075f6cf (patch) | |
tree | ba0ddfae17312fb449fb4c1f1a294c4f7db0f998 /sound/core | |
parent | 49045d3d4dc7c43310b1fca693e29fcdbe68faba (diff) |
[ALSA] sparse address space annotations
ALSA Core,RawMidi Midlevel,ALSA<-OSS emulation,ALSA sequencer
RME32 driver,RME96 driver,EMU10K1/EMU10K2 driver,NM256 driver
Add sparse annotations where we do strange this with __iomem/__user
pointers.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/memory.c | 4 | ||||
-rw-r--r-- | sound/core/oss/pcm_oss.c | 7 | ||||
-rw-r--r-- | sound/core/rawmidi.c | 8 | ||||
-rw-r--r-- | sound/core/seq/seq_clientmgr.c | 7 |
4 files changed, 18 insertions, 8 deletions
diff --git a/sound/core/memory.c b/sound/core/memory.c index 291b4769bde3..8fa888fc53a0 100644 --- a/sound/core/memory.c +++ b/sound/core/memory.c | |||
@@ -249,7 +249,7 @@ int __exit snd_memory_info_done(void) | |||
249 | int copy_to_user_fromio(void __user *dst, const volatile void __iomem *src, size_t count) | 249 | int copy_to_user_fromio(void __user *dst, const volatile void __iomem *src, size_t count) |
250 | { | 250 | { |
251 | #if defined(__i386__) || defined(CONFIG_SPARC32) | 251 | #if defined(__i386__) || defined(CONFIG_SPARC32) |
252 | return copy_to_user(dst, (const void*)src, count) ? -EFAULT : 0; | 252 | return copy_to_user(dst, (const void __force*)src, count) ? -EFAULT : 0; |
253 | #else | 253 | #else |
254 | char buf[256]; | 254 | char buf[256]; |
255 | while (count) { | 255 | while (count) { |
@@ -280,7 +280,7 @@ int copy_to_user_fromio(void __user *dst, const volatile void __iomem *src, size | |||
280 | int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size_t count) | 280 | int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size_t count) |
281 | { | 281 | { |
282 | #if defined(__i386__) || defined(CONFIG_SPARC32) | 282 | #if defined(__i386__) || defined(CONFIG_SPARC32) |
283 | return copy_from_user((void*)dst, src, count) ? -EFAULT : 0; | 283 | return copy_from_user((void __force *)dst, src, count) ? -EFAULT : 0; |
284 | #else | 284 | #else |
285 | char buf[256]; | 285 | char buf[256]; |
286 | while (count) { | 286 | while (count) { |
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index a13bd7bb4c9f..1e606399d74a 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c | |||
@@ -850,7 +850,9 @@ static ssize_t snd_pcm_oss_write1(snd_pcm_substream_t *substream, const char __u | |||
850 | return xfer > 0 ? xfer : -EAGAIN; | 850 | return xfer > 0 ? xfer : -EAGAIN; |
851 | } | 851 | } |
852 | } else { | 852 | } else { |
853 | tmp = snd_pcm_oss_write2(substream, (const char *)buf, runtime->oss.period_bytes, 0); | 853 | tmp = snd_pcm_oss_write2(substream, |
854 | (const char __force *)buf, | ||
855 | runtime->oss.period_bytes, 0); | ||
854 | if (tmp <= 0) | 856 | if (tmp <= 0) |
855 | return xfer > 0 ? (snd_pcm_sframes_t)xfer : tmp; | 857 | return xfer > 0 ? (snd_pcm_sframes_t)xfer : tmp; |
856 | runtime->oss.bytes += tmp; | 858 | runtime->oss.bytes += tmp; |
@@ -926,7 +928,8 @@ static ssize_t snd_pcm_oss_read1(snd_pcm_substream_t *substream, char __user *bu | |||
926 | xfer += tmp; | 928 | xfer += tmp; |
927 | runtime->oss.buffer_used -= tmp; | 929 | runtime->oss.buffer_used -= tmp; |
928 | } else { | 930 | } else { |
929 | tmp = snd_pcm_oss_read2(substream, (char *)buf, runtime->oss.period_bytes, 0); | 931 | tmp = snd_pcm_oss_read2(substream, (char __force *)buf, |
932 | runtime->oss.period_bytes, 0); | ||
930 | if (tmp <= 0) | 933 | if (tmp <= 0) |
931 | return xfer > 0 ? (snd_pcm_sframes_t)xfer : tmp; | 934 | return xfer > 0 ? (snd_pcm_sframes_t)xfer : tmp; |
932 | runtime->oss.bytes += tmp; | 935 | runtime->oss.bytes += tmp; |
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index edba4118271c..d705ec79429b 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c | |||
@@ -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; |
@@ -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; |
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c index d8f76afd284b..bd106625a783 100644 --- a/sound/core/seq/seq_clientmgr.c +++ b/sound/core/seq/seq_clientmgr.c | |||
@@ -413,7 +413,9 @@ static ssize_t snd_seq_read(struct file *file, char __user *buf, size_t count, l | |||
413 | } | 413 | } |
414 | count -= sizeof(snd_seq_event_t); | 414 | count -= sizeof(snd_seq_event_t); |
415 | buf += sizeof(snd_seq_event_t); | 415 | buf += sizeof(snd_seq_event_t); |
416 | err = snd_seq_expand_var_event(&cell->event, count, (char *)buf, 0, sizeof(snd_seq_event_t)); | 416 | err = snd_seq_expand_var_event(&cell->event, count, |
417 | (char __force *)buf, 0, | ||
418 | sizeof(snd_seq_event_t)); | ||
417 | if (err < 0) | 419 | if (err < 0) |
418 | break; | 420 | break; |
419 | result += err; | 421 | result += err; |
@@ -1009,7 +1011,8 @@ static ssize_t snd_seq_write(struct file *file, const char __user *buf, size_t c | |||
1009 | } | 1011 | } |
1010 | /* set user space pointer */ | 1012 | /* set user space pointer */ |
1011 | event.data.ext.len = extlen | SNDRV_SEQ_EXT_USRPTR; | 1013 | event.data.ext.len = extlen | SNDRV_SEQ_EXT_USRPTR; |
1012 | event.data.ext.ptr = (char*)buf + sizeof(snd_seq_event_t); | 1014 | event.data.ext.ptr = (char __force *)buf |
1015 | + sizeof(snd_seq_event_t); | ||
1013 | len += extlen; /* increment data length */ | 1016 | len += extlen; /* increment data length */ |
1014 | } else { | 1017 | } else { |
1015 | #ifdef CONFIG_COMPAT | 1018 | #ifdef CONFIG_COMPAT |