From: Daniel Axtens Date: Mon, 30 Jan 2017 06:41:54 +0000 (+1100) Subject: powerpc/sparse: Constify the address pointer in __get_user_nocheck() X-Git-Tag: v5.15~11761^2~108 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d466f6c5cac17e0c9f22bd4250020bf885049db7;p=platform%2Fkernel%2Flinux-starfive.git powerpc/sparse: Constify the address pointer in __get_user_nocheck() In __get_user_nocheck, 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_nocheck macro. Signed-off-by: Daniel Axtens Signed-off-by: Michael Ellerman --- diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h index 71d81cb..44ded41 100644 --- a/arch/powerpc/include/asm/uaccess.h +++ b/arch/powerpc/include/asm/uaccess.h @@ -261,7 +261,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); \ if (!is_kernel_addr((unsigned long)__gu_addr)) \ might_fault(); \