]> Git Repo - linux.git/commitdiff
powerpc/sparse: Constify the address pointer in __get_user_nosleep()
authorDaniel Axtens <[email protected]>
Mon, 30 Jan 2017 06:41:55 +0000 (17:41 +1100)
committerMichael Ellerman <[email protected]>
Thu, 2 Feb 2017 05:35:21 +0000 (16:35 +1100)
In __get_user_nosleep, we create an intermediate pointer for the
user address we're about to fetch. We currently don't tag this
pointer as const. Make it const, as we are simply dereferencing
it, and it's scope is limited to the __get_user_nosleep macro.

Signed-off-by: Daniel Axtens <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
arch/powerpc/include/asm/uaccess.h

index 44ded4193001700bd07c2962b3ebbbff07aa1610..0e6add3187bca65295a80f9763ff42fcf3caae47 100644 (file)
@@ -286,7 +286,7 @@ do {                                                                \
 ({                                                             \
        long __gu_err;                                          \
        unsigned long __gu_val;                                 \
-       __typeof__(*(ptr)) __user *__gu_addr = (ptr);   \
+       const __typeof__(*(ptr)) __user *__gu_addr = (ptr);     \
        __chk_user_ptr(ptr);                                    \
        __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
        (x) = (__force __typeof__(*(ptr)))__gu_val;                     \
This page took 0.063254 seconds and 4 git commands to generate.