Skip to content

Commit 9e2b6ed

Browse files
lucvooGreg Ungerer
authored andcommitted
m68k,nommu: fix implicit cast from __user in __{get,put}_user_asm()
The assembly for __get_user_asm() & __put_user_asm() uses memcpy() when the size is 8. However, the pointer is always a __user one while memcpy() expects a plain one and so this cast creates a lot of warnings when using Sparse. So, fix this by adding a cast to 'void __force *' at memcpy()'s argument. Reported-by: kbuild test robot <[email protected]> Signed-off-by: Luc Van Oostenryck <[email protected]> Signed-off-by: Greg Ungerer <[email protected]>
1 parent ce3e837 commit 9e2b6ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/m68k/include/asm/uaccess_no.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static inline int _access_ok(unsigned long addr, unsigned long size)
4242
__put_user_asm(__pu_err, __pu_val, ptr, l); \
4343
break; \
4444
case 8: \
45-
memcpy(ptr, &__pu_val, sizeof (*(ptr))); \
45+
memcpy((void __force *)ptr, &__pu_val, sizeof(*(ptr))); \
4646
break; \
4747
default: \
4848
__pu_err = __put_user_bad(); \
@@ -85,7 +85,7 @@ extern int __put_user_bad(void);
8585
u64 l; \
8686
__typeof__(*(ptr)) t; \
8787
} __gu_val; \
88-
memcpy(&__gu_val.l, ptr, sizeof(__gu_val.l)); \
88+
memcpy(&__gu_val.l, (const void __force *)ptr, sizeof(__gu_val.l)); \
8989
(x) = __gu_val.t; \
9090
break; \
9191
} \

0 commit comments

Comments
 (0)