diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2005-10-07 02:46:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-08 18:00:57 -0400 |
commit | dd0fc66fb33cd610bc1a5db8a5e232d34879b4d7 (patch) | |
tree | 51f96a9db96293b352e358f66032e1f4ff79fafb /sound | |
parent | 3b0e77bd144203a507eb191f7117d2c5004ea1de (diff) |
[PATCH] gfp flags annotations - part 1
- added typedef unsigned int __nocast gfp_t;
- replaced __nocast uses for gfp flags with gfp_t - it gives exactly
the same warnings as far as sparse is concerned, doesn't change
generated code (from gcc point of view we replaced unsigned int with
typedef) and documents what's going on far better.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/memalloc.c | 2 | ||||
-rw-r--r-- | sound/core/memory.c | 10 | ||||
-rw-r--r-- | sound/core/seq/instr/ainstr_iw.c | 2 | ||||
-rw-r--r-- | sound/core/wrappers.c | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c index 91124ddbdda..e72cec77f0d 100644 --- a/sound/core/memalloc.c +++ b/sound/core/memalloc.c | |||
@@ -106,7 +106,7 @@ struct snd_mem_list { | |||
106 | 106 | ||
107 | static void *snd_dma_hack_alloc_coherent(struct device *dev, size_t size, | 107 | static void *snd_dma_hack_alloc_coherent(struct device *dev, size_t size, |
108 | dma_addr_t *dma_handle, | 108 | dma_addr_t *dma_handle, |
109 | unsigned int __nocast flags) | 109 | gfp_t flags) |
110 | { | 110 | { |
111 | void *ret; | 111 | void *ret; |
112 | u64 dma_mask, coherent_dma_mask; | 112 | u64 dma_mask, coherent_dma_mask; |
diff --git a/sound/core/memory.c b/sound/core/memory.c index 8fa888fc53a..7d8e2eebba5 100644 --- a/sound/core/memory.c +++ b/sound/core/memory.c | |||
@@ -89,7 +89,7 @@ void snd_memory_done(void) | |||
89 | } | 89 | } |
90 | } | 90 | } |
91 | 91 | ||
92 | static void *__snd_kmalloc(size_t size, unsigned int __nocast flags, void *caller) | 92 | static void *__snd_kmalloc(size_t size, gfp_t flags, void *caller) |
93 | { | 93 | { |
94 | unsigned long cpu_flags; | 94 | unsigned long cpu_flags; |
95 | struct snd_alloc_track *t; | 95 | struct snd_alloc_track *t; |
@@ -111,12 +111,12 @@ static void *__snd_kmalloc(size_t size, unsigned int __nocast flags, void *calle | |||
111 | } | 111 | } |
112 | 112 | ||
113 | #define _snd_kmalloc(size, flags) __snd_kmalloc((size), (flags), __builtin_return_address(0)); | 113 | #define _snd_kmalloc(size, flags) __snd_kmalloc((size), (flags), __builtin_return_address(0)); |
114 | void *snd_hidden_kmalloc(size_t size, unsigned int __nocast flags) | 114 | void *snd_hidden_kmalloc(size_t size, gfp_t flags) |
115 | { | 115 | { |
116 | return _snd_kmalloc(size, flags); | 116 | return _snd_kmalloc(size, flags); |
117 | } | 117 | } |
118 | 118 | ||
119 | void *snd_hidden_kzalloc(size_t size, unsigned int __nocast flags) | 119 | void *snd_hidden_kzalloc(size_t size, gfp_t flags) |
120 | { | 120 | { |
121 | void *ret = _snd_kmalloc(size, flags); | 121 | void *ret = _snd_kmalloc(size, flags); |
122 | if (ret) | 122 | if (ret) |
@@ -125,7 +125,7 @@ void *snd_hidden_kzalloc(size_t size, unsigned int __nocast flags) | |||
125 | } | 125 | } |
126 | EXPORT_SYMBOL(snd_hidden_kzalloc); | 126 | EXPORT_SYMBOL(snd_hidden_kzalloc); |
127 | 127 | ||
128 | void *snd_hidden_kcalloc(size_t n, size_t size, unsigned int __nocast flags) | 128 | void *snd_hidden_kcalloc(size_t n, size_t size, gfp_t flags) |
129 | { | 129 | { |
130 | void *ret = NULL; | 130 | void *ret = NULL; |
131 | if (n != 0 && size > INT_MAX / n) | 131 | if (n != 0 && size > INT_MAX / n) |
@@ -190,7 +190,7 @@ void snd_hidden_vfree(void *obj) | |||
190 | snd_wrapper_vfree(obj); | 190 | snd_wrapper_vfree(obj); |
191 | } | 191 | } |
192 | 192 | ||
193 | char *snd_hidden_kstrdup(const char *s, unsigned int __nocast flags) | 193 | char *snd_hidden_kstrdup(const char *s, gfp_t flags) |
194 | { | 194 | { |
195 | int len; | 195 | int len; |
196 | char *buf; | 196 | char *buf; |
diff --git a/sound/core/seq/instr/ainstr_iw.c b/sound/core/seq/instr/ainstr_iw.c index b3cee092b1a..67c24c8e8e7 100644 --- a/sound/core/seq/instr/ainstr_iw.c +++ b/sound/core/seq/instr/ainstr_iw.c | |||
@@ -58,7 +58,7 @@ static int snd_seq_iwffff_copy_env_from_stream(__u32 req_stype, | |||
58 | iwffff_xenv_t *ex, | 58 | iwffff_xenv_t *ex, |
59 | char __user **data, | 59 | char __user **data, |
60 | long *len, | 60 | long *len, |
61 | unsigned int __nocast gfp_mask) | 61 | gfp_t gfp_mask) |
62 | { | 62 | { |
63 | __u32 stype; | 63 | __u32 stype; |
64 | iwffff_env_record_t *rp, *rp_last; | 64 | iwffff_env_record_t *rp, *rp_last; |
diff --git a/sound/core/wrappers.c b/sound/core/wrappers.c index 508e6d67ee1..296b716f137 100644 --- a/sound/core/wrappers.c +++ b/sound/core/wrappers.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include <linux/fs.h> | 27 | #include <linux/fs.h> |
28 | 28 | ||
29 | #ifdef CONFIG_SND_DEBUG_MEMORY | 29 | #ifdef CONFIG_SND_DEBUG_MEMORY |
30 | void *snd_wrapper_kmalloc(size_t size, unsigned int __nocast flags) | 30 | void *snd_wrapper_kmalloc(size_t size, gfp_t flags) |
31 | { | 31 | { |
32 | return kmalloc(size, flags); | 32 | return kmalloc(size, flags); |
33 | } | 33 | } |