]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Blackfin: fix sparse warnings in copy_to/from_user
authorMikhail Gruzdev <michail.gruzdev@gmail.com>
Sat, 6 Aug 2011 06:44:51 +0000 (10:44 +0400)
committerMike Frysinger <vapier@gentoo.org>
Fri, 12 Aug 2011 02:00:01 +0000 (22:00 -0400)
 Fix argument types for copy_to_user.
 Fix following sparse warnings:
 arch/blackfin/include/asm/uaccess.h:198:14: warning: incorrect type
in argument 2 (different address spaces)
 arch/blackfin/include/asm/uaccess.h:198:14:    expected void const *s
 arch/blackfin/include/asm/uaccess.h:198:14:    got void const
[noderef] <asn:1>*from
 arch/blackfin/include/asm/uaccess.h:208:14: warning: incorrect type
in argument 2 (different address spaces)
 arch/blackfin/include/asm/uaccess.h:208:14:    expected void const *s
 arch/blackfin/include/asm/uaccess.h:208:14:    got void const
[noderef] <asn:1>*from

Signed-off-by: Mikhail Gruzdev <michail.gruzdev@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
arch/blackfin/include/asm/uaccess.h

index 1c0d190adaefa7a6555dfd079b7bac0da273b175..5cc111502822f70a970a6c91daf9971c3386cc84 100644 (file)
@@ -195,17 +195,17 @@ static inline unsigned long __must_check
 copy_from_user(void *to, const void __user *from, unsigned long n)
 {
        if (access_ok(VERIFY_READ, from, n))
-               memcpy(to, from, n);
+               memcpy(to, (const void __force *)from, n);
        else
                return n;
        return 0;
 }
 
 static inline unsigned long __must_check
-copy_to_user(void *to, const void __user *from, unsigned long n)
+copy_to_user(void __user *to, const void *from, unsigned long n)
 {
        if (access_ok(VERIFY_WRITE, to, n))
-               memcpy(to, from, n);
+               memcpy((void __force *)to, from, n);
        else
                return n;
        return 0;