linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] asm-generic: mark __{get,put}_user_fn as __always_inline
@ 2020-10-27  8:50 Christoph Hellwig
  2020-10-27 15:14 ` Arnd Bergmann
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2020-10-27  8:50 UTC (permalink / raw)
  To: arnd; +Cc: palmerdabbelt, linux-arch, linux-kernel, kernel test robot

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")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 include/asm-generic/uaccess.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h
index 45f9872fd74759..4973328f3c6e75 100644
--- a/include/asm-generic/uaccess.h
+++ b/include/asm-generic/uaccess.h
@@ -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));
 
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] asm-generic: mark __{get,put}_user_fn as __always_inline
  2020-10-27  8:50 [PATCH] asm-generic: mark __{get,put}_user_fn as __always_inline Christoph Hellwig
@ 2020-10-27 15:14 ` Arnd Bergmann
  0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2020-10-27 15:14 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Arnd Bergmann, kernel test robot, palmerdabbelt, linux-arch,
	linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

On Tue, 27 Oct 2020 09:50:17 +0100, Christoph Hellwig wrote:
> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-27 15:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-27  8:50 [PATCH] asm-generic: mark __{get,put}_user_fn as __always_inline Christoph Hellwig
2020-10-27 15:14 ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).