55
55
* as usual) and both source and destination can trigger faults.
56
56
*/
57
57
58
- static __always_inline unsigned long
58
+ static __always_inline __must_check unsigned long
59
59
__copy_from_user_inatomic (void * to , const void __user * from , unsigned long n )
60
60
{
61
61
kasan_check_write (to , n );
62
62
check_object_size (to , n , false);
63
63
return raw_copy_from_user (to , from , n );
64
64
}
65
65
66
- static __always_inline unsigned long
66
+ static __always_inline __must_check unsigned long
67
67
__copy_from_user (void * to , const void __user * from , unsigned long n )
68
68
{
69
69
might_fault ();
@@ -85,15 +85,15 @@ __copy_from_user(void *to, const void __user *from, unsigned long n)
85
85
* The caller should also make sure he pins the user space address
86
86
* so that we don't result in page fault and sleep.
87
87
*/
88
- static __always_inline unsigned long
88
+ static __always_inline __must_check unsigned long
89
89
__copy_to_user_inatomic (void __user * to , const void * from , unsigned long n )
90
90
{
91
91
kasan_check_read (from , n );
92
92
check_object_size (from , n , true);
93
93
return raw_copy_to_user (to , from , n );
94
94
}
95
95
96
- static __always_inline unsigned long
96
+ static __always_inline __must_check unsigned long
97
97
__copy_to_user (void __user * to , const void * from , unsigned long n )
98
98
{
99
99
might_fault ();
@@ -103,7 +103,7 @@ __copy_to_user(void __user *to, const void *from, unsigned long n)
103
103
}
104
104
105
105
#ifdef INLINE_COPY_FROM_USER
106
- static inline unsigned long
106
+ static inline __must_check unsigned long
107
107
_copy_from_user (void * to , const void __user * from , unsigned long n )
108
108
{
109
109
unsigned long res = n ;
@@ -117,12 +117,12 @@ _copy_from_user(void *to, const void __user *from, unsigned long n)
117
117
return res ;
118
118
}
119
119
#else
120
- extern unsigned long
120
+ extern __must_check unsigned long
121
121
_copy_from_user (void * , const void __user * , unsigned long );
122
122
#endif
123
123
124
124
#ifdef INLINE_COPY_TO_USER
125
- static inline unsigned long
125
+ static inline __must_check unsigned long
126
126
_copy_to_user (void __user * to , const void * from , unsigned long n )
127
127
{
128
128
might_fault ();
@@ -133,7 +133,7 @@ _copy_to_user(void __user *to, const void *from, unsigned long n)
133
133
return n ;
134
134
}
135
135
#else
136
- extern unsigned long
136
+ extern __must_check unsigned long
137
137
_copy_to_user (void __user * , const void * , unsigned long );
138
138
#endif
139
139
@@ -222,8 +222,9 @@ static inline bool pagefault_disabled(void)
222
222
223
223
#ifndef ARCH_HAS_NOCACHE_UACCESS
224
224
225
- static inline unsigned long __copy_from_user_inatomic_nocache (void * to ,
226
- const void __user * from , unsigned long n )
225
+ static inline __must_check unsigned long
226
+ __copy_from_user_inatomic_nocache (void * to , const void __user * from ,
227
+ unsigned long n )
227
228
{
228
229
return __copy_from_user_inatomic (to , from , n );
229
230
}
0 commit comments