Commit 5a0f217d96656068f0f1e5cda16c35945f979b16
Committed by
Jaroslav Kysela
1 parent
854af9578c
Exists in
master
and in
39 other branches
[ALSA] sound/core Fix the sparse warning 'implicit cast to nocast type'
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>
Showing 7 changed files with 18 additions and 14 deletions Side-by-side Diff
include/sound/core.h
... | ... | @@ -290,12 +290,12 @@ |
290 | 290 | void snd_memory_done(void); |
291 | 291 | int snd_memory_info_init(void); |
292 | 292 | int snd_memory_info_done(void); |
293 | -void *snd_hidden_kmalloc(size_t size, int flags); | |
294 | -void *snd_hidden_kcalloc(size_t n, size_t size, int flags); | |
293 | +void *snd_hidden_kmalloc(size_t size, unsigned int __nocast flags); | |
294 | +void *snd_hidden_kcalloc(size_t n, size_t size, unsigned int __nocast flags); | |
295 | 295 | void snd_hidden_kfree(const void *obj); |
296 | 296 | void *snd_hidden_vmalloc(unsigned long size); |
297 | 297 | void snd_hidden_vfree(void *obj); |
298 | -char *snd_hidden_kstrdup(const char *s, int flags); | |
298 | +char *snd_hidden_kstrdup(const char *s, unsigned int __nocast flags); | |
299 | 299 | #define kmalloc(size, flags) snd_hidden_kmalloc(size, flags) |
300 | 300 | #define kcalloc(n, size, flags) snd_hidden_kcalloc(n, size, flags) |
301 | 301 | #define kfree(obj) snd_hidden_kfree(obj) |
include/sound/driver.h
... | ... | @@ -51,7 +51,7 @@ |
51 | 51 | #ifdef CONFIG_SND_DEBUG_MEMORY |
52 | 52 | #include <linux/slab.h> |
53 | 53 | #include <linux/vmalloc.h> |
54 | -void *snd_wrapper_kmalloc(size_t, int); | |
54 | +void *snd_wrapper_kmalloc(size_t, unsigned int __nocast); | |
55 | 55 | #undef kmalloc |
56 | 56 | void snd_wrapper_kfree(const void *); |
57 | 57 | #undef kfree |
sound/core/memalloc.c
... | ... | @@ -105,7 +105,8 @@ |
105 | 105 | */ |
106 | 106 | |
107 | 107 | static void *snd_dma_hack_alloc_coherent(struct device *dev, size_t size, |
108 | - dma_addr_t *dma_handle, int flags) | |
108 | + dma_addr_t *dma_handle, | |
109 | + unsigned int __nocast flags) | |
109 | 110 | { |
110 | 111 | void *ret; |
111 | 112 | u64 dma_mask, coherent_dma_mask; |
sound/core/memory.c
... | ... | @@ -89,7 +89,7 @@ |
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
92 | -static void *__snd_kmalloc(size_t size, int flags, void *caller) | |
92 | +static void *__snd_kmalloc(size_t size, unsigned int __nocast flags, void *caller) | |
93 | 93 | { |
94 | 94 | unsigned long cpu_flags; |
95 | 95 | struct snd_alloc_track *t; |
96 | 96 | |
... | ... | @@ -111,12 +111,12 @@ |
111 | 111 | } |
112 | 112 | |
113 | 113 | #define _snd_kmalloc(size, flags) __snd_kmalloc((size), (flags), __builtin_return_address(0)); |
114 | -void *snd_hidden_kmalloc(size_t size, int flags) | |
114 | +void *snd_hidden_kmalloc(size_t size, unsigned int __nocast flags) | |
115 | 115 | { |
116 | 116 | return _snd_kmalloc(size, flags); |
117 | 117 | } |
118 | 118 | |
119 | -void *snd_hidden_kcalloc(size_t n, size_t size, int flags) | |
119 | +void *snd_hidden_kcalloc(size_t n, size_t size, unsigned int __nocast flags) | |
120 | 120 | { |
121 | 121 | void *ret = NULL; |
122 | 122 | if (n != 0 && size > INT_MAX / n) |
... | ... | @@ -184,7 +184,7 @@ |
184 | 184 | snd_wrapper_vfree(obj); |
185 | 185 | } |
186 | 186 | |
187 | -char *snd_hidden_kstrdup(const char *s, int flags) | |
187 | +char *snd_hidden_kstrdup(const char *s, unsigned int __nocast flags) | |
188 | 188 | { |
189 | 189 | int len; |
190 | 190 | char *buf; |
sound/core/seq/instr/ainstr_gf1.c
sound/core/seq/instr/ainstr_iw.c
... | ... | @@ -58,7 +58,7 @@ |
58 | 58 | iwffff_xenv_t *ex, |
59 | 59 | char __user **data, |
60 | 60 | long *len, |
61 | - int gfp_mask) | |
61 | + unsigned int __nocast gfp_mask) | |
62 | 62 | { |
63 | 63 | __u32 stype; |
64 | 64 | iwffff_env_record_t *rp, *rp_last; |
... | ... | @@ -128,7 +128,8 @@ |
128 | 128 | { |
129 | 129 | iwffff_wave_t *wp, *prev; |
130 | 130 | iwffff_xwave_t xp; |
131 | - int err, gfp_mask; | |
131 | + int err; | |
132 | + unsigned int gfp_mask; | |
132 | 133 | unsigned int real_size; |
133 | 134 | |
134 | 135 | gfp_mask = atomic ? GFP_ATOMIC : GFP_KERNEL; |
... | ... | @@ -234,7 +235,8 @@ |
234 | 235 | iwffff_xinstrument_t ix; |
235 | 236 | iwffff_layer_t *lp, *prev_lp; |
236 | 237 | iwffff_xlayer_t lx; |
237 | - int err, gfp_mask; | |
238 | + int err; | |
239 | + unsigned int gfp_mask; | |
238 | 240 | |
239 | 241 | if (cmd != SNDRV_SEQ_INSTR_PUT_CMD_CREATE) |
240 | 242 | return -EINVAL; |
sound/core/wrappers.c