powerpc/uaccess: Merge raw_copy_to_user_allowed() into raw_copy_to_user()
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Tue, 9 Feb 2021 14:02:14 +0000 (14:02 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 11 Feb 2021 12:35:35 +0000 (23:35 +1100)
Since commit 17bc43367fc2 ("powerpc/uaccess: Implement
unsafe_copy_to_user() as a simple loop"), raw_copy_to_user_allowed()
is only used by raw_copy_to_user().

Merge raw_copy_to_user_allowed() into raw_copy_to_user().

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/3ae114740317187e12edbd5ffa9157cb8c396dea.1612879284.git.christophe.leroy@csgroup.eu
arch/powerpc/include/asm/uaccess.h

index 297ee141c33afabfed61c4f9352f6abb94bece2c..78e2a3990eab30c8c7aeac12914f9ea7f3b52308 100644 (file)
@@ -401,19 +401,13 @@ static inline unsigned long raw_copy_from_user(void *to,
        return ret;
 }
 
-static inline unsigned long
-raw_copy_to_user_allowed(void __user *to, const void *from, unsigned long n)
-{
-       return __copy_tofrom_user(to, (__force const void __user *)from, n);
-}
-
 static inline unsigned long
 raw_copy_to_user(void __user *to, const void *from, unsigned long n)
 {
        unsigned long ret;
 
        allow_write_to_user(to, n);
-       ret = raw_copy_to_user_allowed(to, from, n);
+       ret = __copy_tofrom_user(to, (__force const void __user *)from, n);
        prevent_write_to_user(to, n);
        return ret;
 }