summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQing Zhang <zhangqing@loongson.cn>2022-08-06 10:19:32 +0300
committerHuacai Chen <chenhuacai@loongson.cn>2022-08-12 08:10:10 +0300
commit5e8be07ca8f7f49d49c6d5d44f69caaa2fa4b660 (patch)
tree1059f87b03be724b02353a65150d096c7e3a37a9
parentaafcac81b0e3f0d7383a78c6249e90e166ac8e6d (diff)
downloadlinux-5e8be07ca8f7f49d49c6d5d44f69caaa2fa4b660.tar.xz
LoongArch: Requires __force attributes for any casts
This fix a warning when "make C=2": arch/loongarch/kernel/ptrace.c: note: in included file (through include/linux/uaccess.h, include/linux/sched/task.h, include/linux/sched/signal.h, include/linux/ptrace.h, include/linux/audit.h): ./arch/loongarch/include/asm/uaccess.h:232:32: warning: incorrect type in argument 2 (different address spaces) ./arch/loongarch/include/asm/uaccess.h:232:32: expected void const *from ./arch/loongarch/include/asm/uaccess.h:232:32: got void const [noderef] __user *from Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Qing Zhang <zhangqing@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
-rw-r--r--arch/loongarch/include/asm/uaccess.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/loongarch/include/asm/uaccess.h b/arch/loongarch/include/asm/uaccess.h
index 2b44edc604a2..a8ae2af4025a 100644
--- a/arch/loongarch/include/asm/uaccess.h
+++ b/arch/loongarch/include/asm/uaccess.h
@@ -229,13 +229,13 @@ extern unsigned long __copy_user(void *to, const void *from, __kernel_size_t n);
static inline unsigned long __must_check
raw_copy_from_user(void *to, const void __user *from, unsigned long n)
{
- return __copy_user(to, from, n);
+ return __copy_user(to, (__force const void *)from, n);
}
static inline unsigned long __must_check
raw_copy_to_user(void __user *to, const void *from, unsigned long n)
{
- return __copy_user(to, from, n);
+ return __copy_user((__force void *)to, from, n);
}
#define INLINE_COPY_FROM_USER