summaryrefslogtreecommitdiff
path: root/include/asm-generic/uaccess.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-generic/uaccess.h')
-rw-r--r--include/asm-generic/uaccess.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h
index 723e81a6c162..6b2e63df2739 100644
--- a/include/asm-generic/uaccess.h
+++ b/include/asm-generic/uaccess.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ASM_GENERIC_UACCESS_H
#define __ASM_GENERIC_UACCESS_H
@@ -75,10 +76,10 @@ static inline int __access_ok(unsigned long addr, unsigned long size)
#define put_user(x, ptr) \
({ \
- void *__p = (ptr); \
+ void __user *__p = (ptr); \
might_fault(); \
access_ok(VERIFY_WRITE, __p, sizeof(*ptr)) ? \
- __put_user((x), ((__typeof__(*(ptr)) *)__p)) : \
+ __put_user((x), ((__typeof__(*(ptr)) __user *)__p)) : \
-EFAULT; \
})
@@ -137,10 +138,10 @@ extern int __put_user_bad(void) __attribute__((noreturn));
#define get_user(x, ptr) \
({ \
- const void *__p = (ptr); \
+ const void __user *__p = (ptr); \
might_fault(); \
access_ok(VERIFY_READ, __p, sizeof(*ptr)) ? \
- __get_user((x), (__typeof__(*(ptr)) *)__p) : \
+ __get_user((x), (__typeof__(*(ptr)) __user *)__p) :\
((x) = (__typeof__(*(ptr)))0,-EFAULT); \
})