]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[ALSA] sparse address space annotations
authorClemens Ladisch <clemens@ladisch.de>
Mon, 5 Sep 2005 08:35:20 +0000 (10:35 +0200)
committerJaroslav Kysela <perex@suse.cz>
Mon, 12 Sep 2005 08:41:16 +0000 (10:41 +0200)
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>
sound/core/memory.c
sound/core/oss/pcm_oss.c
sound/core/rawmidi.c
sound/core/seq/seq_clientmgr.c
sound/pci/emu10k1/emufx.c
sound/pci/nm256/nm256.c
sound/pci/rme32.c
sound/pci/rme96.c

index 291b4769bde38f2bf2775958ce94f200e62f9732..8fa888fc53a0a6b8d717142240960696e959db12 100644 (file)
@@ -249,7 +249,7 @@ int __exit snd_memory_info_done(void)
 int copy_to_user_fromio(void __user *dst, const volatile void __iomem *src, size_t count)
 {
 #if defined(__i386__) || defined(CONFIG_SPARC32)
-       return copy_to_user(dst, (const void*)src, count) ? -EFAULT : 0;
+       return copy_to_user(dst, (const void __force*)src, count) ? -EFAULT : 0;
 #else
        char buf[256];
        while (count) {
@@ -280,7 +280,7 @@ int copy_to_user_fromio(void __user *dst, const volatile void __iomem *src, size
 int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size_t count)
 {
 #if defined(__i386__) || defined(CONFIG_SPARC32)
-       return copy_from_user((void*)dst, src, count) ? -EFAULT : 0;
+       return copy_from_user((void __force *)dst, src, count) ? -EFAULT : 0;
 #else
        char buf[256];
        while (count) {
index a13bd7bb4c9f08cf6628ce8856f1c56896ba2e9c..1e606399d74af3953ddbe05958ac3c98b76872d7 100644 (file)
@@ -850,7 +850,9 @@ static ssize_t snd_pcm_oss_write1(snd_pcm_substream_t *substream, const char __u
                                        return xfer > 0 ? xfer : -EAGAIN;
                        }
                } else {
-                       tmp = snd_pcm_oss_write2(substream, (const char *)buf, runtime->oss.period_bytes, 0);
+                       tmp = snd_pcm_oss_write2(substream,
+                                                (const char __force *)buf,
+                                                runtime->oss.period_bytes, 0);
                        if (tmp <= 0)
                                return xfer > 0 ? (snd_pcm_sframes_t)xfer : tmp;
                        runtime->oss.bytes += tmp;
@@ -926,7 +928,8 @@ static ssize_t snd_pcm_oss_read1(snd_pcm_substream_t *substream, char __user *bu
                        xfer += tmp;
                        runtime->oss.buffer_used -= tmp;
                } else {
-                       tmp = snd_pcm_oss_read2(substream, (char *)buf, runtime->oss.period_bytes, 0);
+                       tmp = snd_pcm_oss_read2(substream, (char __force *)buf,
+                                               runtime->oss.period_bytes, 0);
                        if (tmp <= 0)
                                return xfer > 0 ? (snd_pcm_sframes_t)xfer : tmp;
                        runtime->oss.bytes += tmp;
index edba4118271c74695d4f3d1715d47255d5160b2f..d705ec79429b27c8852fb59f906b209bf6a0b43d 100644 (file)
@@ -984,7 +984,9 @@ static ssize_t snd_rawmidi_read(struct file *file, char __user *buf, size_t coun
                        spin_lock_irq(&runtime->lock);
                }
                spin_unlock_irq(&runtime->lock);
-               count1 = snd_rawmidi_kernel_read1(substream, (unsigned char *)buf, count, 0);
+               count1 = snd_rawmidi_kernel_read1(substream,
+                                                 (unsigned char __force *)buf,
+                                                 count, 0);
                if (count1 < 0)
                        return result > 0 ? result : count1;
                result += count1;
@@ -1213,7 +1215,9 @@ static ssize_t snd_rawmidi_write(struct file *file, const char __user *buf, size
                        spin_lock_irq(&runtime->lock);
                }
                spin_unlock_irq(&runtime->lock);
-               count1 = snd_rawmidi_kernel_write1(substream, (unsigned char *)buf, count, 0);
+               count1 = snd_rawmidi_kernel_write1(substream,
+                                                  (unsigned char __force *)buf,
+                                                  count, 0);
                if (count1 < 0)
                        return result > 0 ? result : count1;
                result += count1;
index d8f76afd284bc19efec4b1c577280508c99a69db..bd106625a783a7a3bb3e4264573b94729ebca063 100644 (file)
@@ -413,7 +413,9 @@ static ssize_t snd_seq_read(struct file *file, char __user *buf, size_t count, l
                        }
                        count -= sizeof(snd_seq_event_t);
                        buf += sizeof(snd_seq_event_t);
-                       err = snd_seq_expand_var_event(&cell->event, count, (char *)buf, 0, sizeof(snd_seq_event_t));
+                       err = snd_seq_expand_var_event(&cell->event, count,
+                                                      (char __force *)buf, 0,
+                                                      sizeof(snd_seq_event_t));
                        if (err < 0)
                                break;
                        result += err;
@@ -1009,7 +1011,8 @@ static ssize_t snd_seq_write(struct file *file, const char __user *buf, size_t c
                        }
                        /* set user space pointer */
                        event.data.ext.len = extlen | SNDRV_SEQ_EXT_USRPTR;
-                       event.data.ext.ptr = (char*)buf + sizeof(snd_seq_event_t);
+                       event.data.ext.ptr = (char __force *)buf
+                                               + sizeof(snd_seq_event_t);
                        len += extlen; /* increment data length */
                } else {
 #ifdef CONFIG_COMPAT
index 637c555cfdb1f42b4a3be06e98dc806fe20ff839..2f7a03103c91f304a68f686405b88e51222e46ce 100644 (file)
@@ -470,7 +470,7 @@ static void snd_emu10k1_write_op(emu10k1_fx8010_code_t *icode, unsigned int *ptr
 {
        u_int32_t *code;
        snd_assert(*ptr < 512, return);
-       code = (u_int32_t *)icode->code + (*ptr) * 2;
+       code = (u_int32_t __force *)icode->code + (*ptr) * 2;
        set_bit(*ptr, icode->code_valid);
        code[0] = ((x & 0x3ff) << 10) | (y & 0x3ff);
        code[1] = ((op & 0x0f) << 20) | ((r & 0x3ff) << 10) | (a & 0x3ff);
@@ -485,7 +485,7 @@ static void snd_emu10k1_audigy_write_op(emu10k1_fx8010_code_t *icode, unsigned i
 {
        u_int32_t *code;
        snd_assert(*ptr < 1024, return);
-       code = (u_int32_t *)icode->code + (*ptr) * 2;
+       code = (u_int32_t __force *)icode->code + (*ptr) * 2;
        set_bit(*ptr, icode->code_valid);
        code[0] = ((x & 0x7ff) << 12) | (y & 0x7ff);
        code[1] = ((op & 0x0f) << 24) | ((r & 0x7ff) << 12) | (a & 0x7ff);
@@ -1042,7 +1042,7 @@ static int __devinit _snd_emu10k1_audigy_init_efx(emu10k1_t *emu)
                err = -ENOMEM;
                goto __err;
        }
-       gpr_map = (u32 *)icode->gpr_map;
+       gpr_map = (u32 __force *)icode->gpr_map;
 
        icode->tram_data_map = icode->gpr_map + 512;
        icode->tram_addr_map = icode->tram_data_map + 256;
@@ -1431,7 +1431,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
  __err:
        kfree(controls);
        if (icode != NULL) {
-               kfree((void *)icode->gpr_map);
+               kfree((void __force *)icode->gpr_map);
                kfree(icode);
        }
        return err;
@@ -1511,7 +1511,7 @@ static int __devinit _snd_emu10k1_init_efx(emu10k1_t *emu)
                err = -ENOMEM;
                goto __err;
        }
-       gpr_map = (u32 *)icode->gpr_map;
+       gpr_map = (u32 __force *)icode->gpr_map;
 
        icode->tram_data_map = icode->gpr_map + 256;
        icode->tram_addr_map = icode->tram_data_map + 160;
@@ -2032,7 +2032,7 @@ static int __devinit _snd_emu10k1_init_efx(emu10k1_t *emu)
        kfree(ipcm);
        kfree(controls);
        if (icode != NULL) {
-               kfree((void *)icode->gpr_map);
+               kfree((void __force *)icode->gpr_map);
                kfree(icode);
        }
        return err;
index 2bbeb10ff7c4a0c3aa182a98176a0dde05cf461d..24f146b6ebab0a16aa4cf66a6165ec413040216d 100644 (file)
@@ -840,7 +840,7 @@ static void snd_nm256_setup_stream(nm256_t *chip, nm256_stream_t *s,
        runtime->hw = *hw_ptr;
        runtime->hw.buffer_bytes_max = s->bufsize;
        runtime->hw.period_bytes_max = s->bufsize / 2;
-       runtime->dma_area = (void*) s->bufptr;
+       runtime->dma_area = (void __force *) s->bufptr;
        runtime->dma_addr = s->bufptr_addr;
        runtime->dma_bytes = s->bufsize;
        runtime->private_data = s;
index 456be39e8e4a1171f296e2eab71513b0efb4d490..cfb5f44b2d43d895c2a16b99775f88d77231a486 100644 (file)
@@ -692,7 +692,8 @@ snd_rme32_playback_hw_params(snd_pcm_substream_t * substream,
                if (err < 0)
                        return err;
        } else {
-               runtime->dma_area = (void *)(rme32->iobase + RME32_IO_DATA_BUFFER);
+               runtime->dma_area = (void __force *)(rme32->iobase +
+                                                    RME32_IO_DATA_BUFFER);
                runtime->dma_addr = rme32->port + RME32_IO_DATA_BUFFER;
                runtime->dma_bytes = RME32_BUFFER_SIZE;
        }
@@ -746,7 +747,8 @@ snd_rme32_capture_hw_params(snd_pcm_substream_t * substream,
                if (err < 0)
                        return err;
        } else {
-               runtime->dma_area = (void *)rme32->iobase + RME32_IO_DATA_BUFFER;
+               runtime->dma_area = (void __force *)rme32->iobase +
+                                       RME32_IO_DATA_BUFFER;
                runtime->dma_addr = rme32->port + RME32_IO_DATA_BUFFER;
                runtime->dma_bytes = RME32_BUFFER_SIZE;
        }
index 9645e9004a48e49550e7e26d08c091595a52df80..2da33138fa4bd9f4df6d4591f509baad3737926a 100644 (file)
@@ -985,7 +985,8 @@ snd_rme96_playback_hw_params(snd_pcm_substream_t *substream,
        snd_pcm_runtime_t *runtime = substream->runtime;
        int err, rate, dummy;
 
-       runtime->dma_area = (void *)(rme96->iobase + RME96_IO_PLAY_BUFFER);
+       runtime->dma_area = (void __force *)(rme96->iobase +
+                                            RME96_IO_PLAY_BUFFER);
        runtime->dma_addr = rme96->port + RME96_IO_PLAY_BUFFER;
        runtime->dma_bytes = RME96_BUFFER_SIZE;
 
@@ -1037,7 +1038,8 @@ snd_rme96_capture_hw_params(snd_pcm_substream_t *substream,
        snd_pcm_runtime_t *runtime = substream->runtime;
        int err, isadat, rate;
        
-       runtime->dma_area = (void *)(rme96->iobase + RME96_IO_REC_BUFFER);
+       runtime->dma_area = (void __force *)(rme96->iobase +
+                                            RME96_IO_REC_BUFFER);
        runtime->dma_addr = rme96->port + RME96_IO_REC_BUFFER;
        runtime->dma_bytes = RME96_BUFFER_SIZE;