Skip to content

Commit f84ed59

Browse files
daxtensmpe
authored andcommitted
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 <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 0b1c764 commit f84ed59

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/include/asm/uaccess.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ do { \
274274
({ \
275275
long __gu_err = -EFAULT; \
276276
unsigned long __gu_val = 0; \
277-
__typeof__(*(ptr)) __user *__gu_addr = (ptr); \
277+
const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
278278
might_fault(); \
279279
if (access_ok(VERIFY_READ, __gu_addr, (size))) \
280280
__get_user_size(__gu_val, __gu_addr, (size), __gu_err); \

0 commit comments

Comments
 (0)