]> err.no Git - linux-2.6/commitdiff
[ALSA] sound/core Fix the sparse warning 'implicit cast to nocast type'
authorVictor Fusco <victor@cetuc.puc-rio.br>
Tue, 26 Jul 2005 11:42:31 +0000 (13:42 +0200)
committerJaroslav Kysela <perex@suse.cz>
Thu, 28 Jul 2005 10:22:44 +0000 (12:22 +0200)
Memalloc module,ALSA Core,Instrument layer
Fix the sparse warning 'implicit cast to nocast type'

File/Subsystem:sound/core

Signed-off-by: Victor Fusco <victor@cetuc.puc-rio.br>
Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
include/sound/core.h
include/sound/driver.h
sound/core/memalloc.c
sound/core/memory.c
sound/core/seq/instr/ainstr_gf1.c
sound/core/seq/instr/ainstr_iw.c
sound/core/wrappers.c

index 52fcc2f62b9fc051e7d4daad05455b43faf4d1aa..38b357fc8958e991ef4cb53abdc4e6c01993ba88 100644 (file)
@@ -290,12 +290,12 @@ void snd_memory_init(void);
 void snd_memory_done(void);
 int snd_memory_info_init(void);
 int snd_memory_info_done(void);
-void *snd_hidden_kmalloc(size_t size, int flags);
-void *snd_hidden_kcalloc(size_t n, size_t size, int flags);
+void *snd_hidden_kmalloc(size_t size, unsigned int __nocast flags);
+void *snd_hidden_kcalloc(size_t n, size_t size, unsigned int __nocast flags);
 void snd_hidden_kfree(const void *obj);
 void *snd_hidden_vmalloc(unsigned long size);
 void snd_hidden_vfree(void *obj);
-char *snd_hidden_kstrdup(const char *s, int flags);
+char *snd_hidden_kstrdup(const char *s, unsigned int __nocast flags);
 #define kmalloc(size, flags) snd_hidden_kmalloc(size, flags)
 #define kcalloc(n, size, flags) snd_hidden_kcalloc(n, size, flags)
 #define kfree(obj) snd_hidden_kfree(obj)
index 948e9a1aebef518179a46ce1f58dbbd6b15d71e9..0d12456ec3aebda93ce4cf1b449ccd0b77075388 100644 (file)
@@ -51,7 +51,7 @@
 #ifdef CONFIG_SND_DEBUG_MEMORY
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
-void *snd_wrapper_kmalloc(size_t, int);
+void *snd_wrapper_kmalloc(size_t, unsigned int __nocast);
 #undef kmalloc
 void snd_wrapper_kfree(const void *);
 #undef kfree
index dbc23e35fa065decbbeb4910f39d0153073f0c36..02132561c3f845d326f2bbf34a8870efab3439d5 100644 (file)
@@ -105,7 +105,8 @@ struct snd_mem_list {
  */
 
 static void *snd_dma_hack_alloc_coherent(struct device *dev, size_t size,
-                                        dma_addr_t *dma_handle, int flags)
+                                        dma_addr_t *dma_handle,
+                                        unsigned int __nocast flags)
 {
        void *ret;
        u64 dma_mask, coherent_dma_mask;
index c1fb28e8433076c37de10c07adb2675b23c0f7a3..f6895577bf864bb9b715508fde30774af1b8d4cc 100644 (file)
@@ -89,7 +89,7 @@ void snd_memory_done(void)
        }
 }
 
-static void *__snd_kmalloc(size_t size, int flags, void *caller)
+static void *__snd_kmalloc(size_t size, unsigned int __nocast flags, void *caller)
 {
        unsigned long cpu_flags;
        struct snd_alloc_track *t;
@@ -111,12 +111,12 @@ static void *__snd_kmalloc(size_t size, int flags, void *caller)
 }
 
 #define _snd_kmalloc(size, flags) __snd_kmalloc((size), (flags), __builtin_return_address(0));
-void *snd_hidden_kmalloc(size_t size, int flags)
+void *snd_hidden_kmalloc(size_t size, unsigned int __nocast flags)
 {
        return _snd_kmalloc(size, flags);
 }
 
-void *snd_hidden_kcalloc(size_t n, size_t size, int flags)
+void *snd_hidden_kcalloc(size_t n, size_t size, unsigned int __nocast flags)
 {
        void *ret = NULL;
        if (n != 0 && size > INT_MAX / n)
@@ -184,7 +184,7 @@ void snd_hidden_vfree(void *obj)
        snd_wrapper_vfree(obj);
 }
 
-char *snd_hidden_kstrdup(const char *s, int flags)
+char *snd_hidden_kstrdup(const char *s, unsigned int __nocast flags)
 {
        int len;
        char *buf;
index 0779c41ca03769cc84eb6d51eaad6f8094698c93..32e91c6b25febb7cf02b825a1037f7a236fcdf83 100644 (file)
@@ -50,7 +50,8 @@ static int snd_seq_gf1_copy_wave_from_stream(snd_gf1_ops_t *ops,
 {
        gf1_wave_t *wp, *prev;
        gf1_xwave_t xp;
-       int err, gfp_mask;
+       int err;
+       unsigned int gfp_mask;
        unsigned int real_size;
        
        gfp_mask = atomic ? GFP_ATOMIC : GFP_KERNEL;
index 39ff72b2aab367f72f26db366da4aa6cecc929dd..2622b8679ca76be886524be263517560e8f2e43b 100644 (file)
@@ -58,7 +58,7 @@ static int snd_seq_iwffff_copy_env_from_stream(__u32 req_stype,
                                               iwffff_xenv_t *ex,
                                               char __user **data,
                                               long *len,
-                                              int gfp_mask)
+                                              unsigned int __nocast gfp_mask)
 {
        __u32 stype;
        iwffff_env_record_t *rp, *rp_last;
@@ -128,7 +128,8 @@ static int snd_seq_iwffff_copy_wave_from_stream(snd_iwffff_ops_t *ops,
 {
        iwffff_wave_t *wp, *prev;
        iwffff_xwave_t xp;
-       int err, gfp_mask;
+       int err;
+       unsigned int gfp_mask;
        unsigned int real_size;
        
        gfp_mask = atomic ? GFP_ATOMIC : GFP_KERNEL;
@@ -234,7 +235,8 @@ static int snd_seq_iwffff_put(void *private_data, snd_seq_kinstr_t *instr,
        iwffff_xinstrument_t ix;
        iwffff_layer_t *lp, *prev_lp;
        iwffff_xlayer_t lx;
-       int err, gfp_mask;
+       int err;
+       unsigned int gfp_mask;
 
        if (cmd != SNDRV_SEQ_INSTR_PUT_CMD_CREATE)
                return -EINVAL;
index 9f393023c32798bb932e462180adad183bec6e6b..508e6d67ee19ac39255656bbb07065ede0fea06e 100644 (file)
@@ -27,7 +27,7 @@
 #include <linux/fs.h>
 
 #ifdef CONFIG_SND_DEBUG_MEMORY
-void *snd_wrapper_kmalloc(size_t size, int flags)
+void *snd_wrapper_kmalloc(size_t size, unsigned int __nocast flags)
 {
        return kmalloc(size, flags);
 }