aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2012-10-22 10:09:05 -0400
committerBob Liu <lliubbo@gmail.com>2012-12-13 00:50:57 -0500
commit2a7e0775d0b0dfc083f97c72dc885f6dab8dd27b (patch)
tree0cf5120ff01f1818aa940fa6bfa2fd3cdad801e1 /arch/blackfin
parent10dc42b5b262f3bb2e4532759e4e1147ebf6a22f (diff)
Blackfin: Annotate strnlen_user and strlen_user 'src' parameter with __user
The 'src' parameter of strnlen_user and strlen_user is supposed to take a userspace pointer, so annotate it with __user. This fixes the following and similar sparse warnings: fs/binfmt_elf_fdpic.c:671:36: warning: incorrect type in argument 1 (different address spaces) fs/binfmt_elf_fdpic.c:671:36: expected char const *src fs/binfmt_elf_fdpic.c:671:36: got char [noderef] <asn:1>*[assigned] p fs/binfmt_elf_fdpic.c:683:36: warning: incorrect type in argument 1 (different address spaces) fs/binfmt_elf_fdpic.c:683:36: expected char const *src fs/binfmt_elf_fdpic.c:683:36: got char [noderef] <asn:1>*[assigned] p Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Bob Liu <lliubbo@gmail.com>
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/include/asm/uaccess.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/blackfin/include/asm/uaccess.h b/arch/blackfin/include/asm/uaccess.h
index ded2d05847fa..3ee7b4216150 100644
--- a/arch/blackfin/include/asm/uaccess.h
+++ b/arch/blackfin/include/asm/uaccess.h
@@ -237,18 +237,18 @@ strncpy_from_user(char *dst, const char __user *src, long count)
237 * On exception, returns 0. 237 * On exception, returns 0.
238 * If the string is too long, returns a value greater than n. 238 * If the string is too long, returns a value greater than n.
239 */ 239 */
240static inline long __must_check strnlen_user(const char *src, long n) 240static inline long __must_check strnlen_user(const char __user *src, long n)
241{ 241{
242 if (!access_ok(VERIFY_READ, src, 1)) 242 if (!access_ok(VERIFY_READ, src, 1))
243 return 0; 243 return 0;
244 return strnlen(src, n) + 1; 244 return strnlen((const char __force *)src, n) + 1;
245} 245}
246 246
247static inline long __must_check strlen_user(const char *src) 247static inline long __must_check strlen_user(const char __user *src)
248{ 248{
249 if (!access_ok(VERIFY_READ, src, 1)) 249 if (!access_ok(VERIFY_READ, src, 1))
250 return 0; 250 return 0;
251 return strlen(src) + 1; 251 return strlen((const char __force *)src) + 1;
252} 252}
253 253
254/* 254/*