Skip to contentSkip to conversation

asm-generic: mark __{get,put}_user_fn as __always_inline

PATCH Applied Christoph Hellwig 2 participants 2 messages Oct 27, 2020 Generic include/asm header files

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 asm-generic: mark __{get,put}_user_fn as __always_inline

Without the explicit __always_inline, some RISC-V configs place the functions out of line, triggering the BUILD_BUG_ON checks in the function.

Fixes 11129e8ed4d9 ("riscv: use memcpy based uaccess for nommu again")
---
 include/asm-generic/uaccess.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
include/asm-generic/uaccess.h +4 -2
index 45f9872fd74759..4973328f3c6e75 100644
@@ -12,7 +12,8 @@
 #ifdef CONFIG_UACCESS_MEMCPY
 #include <asm/unaligned.h>
 
-static inline int __get_user_fn(size_t size, const void __user *from, void *to)
+static __always_inline int
+__get_user_fn(size_t size, const void __user *from, void *to)
 {
 	BUILD_BUG_ON(!__builtin_constant_p(size));
 
@@ -37,7 +38,8 @@ static inline int __get_user_fn(size_t size, const void __user *from, void *to)
 }
 #define __get_user_fn(sz, u, k)	__get_user_fn(sz, u, k)
 
-static inline int __put_user_fn(size_t size, void __user *to, void *from)
+static __always_inline int
+__put_user_fn(size_t size, void __user *to, void *from)
 {
 	BUILD_BUG_ON(!__builtin_constant_p(size));
 
Signature · 1 line
2.28.0
#1 lore raw

From: Arnd Bergmann <[email protected]>

Quoted 3 lines · Christoph Hellwig

Without the explicit __always_inline, some RISC-V configs place the functions out of line, triggering the BUILD_BUG_ON checks in the function.

Applied to asm-generic-fixes, thanks!

[1/1] asm-generic: mark __{get,put}_user_fn as __always_inline

      commit: 0bcd0a2be8c9ef39d84d167ff85359a49f7be175

       Arnd