소스 검색

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 <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Daniel Axtens 8 년 전
부모
커밋
d466f6c5ca
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      arch/powerpc/include/asm/uaccess.h

+ 1 - 1
arch/powerpc/include/asm/uaccess.h

@@ -261,7 +261,7 @@ do {								\
 ({								\
 ({								\
 	long __gu_err;						\
 	long __gu_err;						\
 	unsigned long __gu_val;					\
 	unsigned long __gu_val;					\
-	__typeof__(*(ptr)) __user *__gu_addr = (ptr);	\
+	const __typeof__(*(ptr)) __user *__gu_addr = (ptr);	\
 	__chk_user_ptr(ptr);					\
 	__chk_user_ptr(ptr);					\
 	if (!is_kernel_addr((unsigned long)__gu_addr))		\
 	if (!is_kernel_addr((unsigned long)__gu_addr))		\
 		might_fault();					\
 		might_fault();					\