From: Daniel Axtens Date: Mon, 30 Jan 2017 06:41:53 +0000 (+1100) Subject: powerpc/sparse: Constify the address pointer in __get_user_check() X-Git-Tag: Ubuntu-5.4-5.4.0-11.14~8382^2~68 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=f84ed59a612d866cde0bd17ad2a52acb524d44c9;p=mirror_ubuntu-focal-kernel.git powerpc/sparse: Constify the address pointer in __get_user_check() In __get_user_check, 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_check 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 a15d84d59356..71d81cbe3781 100644 --- a/arch/powerpc/include/asm/uaccess.h +++ b/arch/powerpc/include/asm/uaccess.h @@ -274,7 +274,7 @@ do { \ ({ \ long __gu_err = -EFAULT; \ unsigned long __gu_val = 0; \ - __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ + const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ might_fault(); \ if (access_ok(VERIFY_READ, __gu_addr, (size))) \ __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \