diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-16 11:26:37 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-16 11:26:37 -0700 |
commit | 27ebbf9d5bc0ab0a8ca875119e0ce4cd267fa2fc (patch) | |
tree | 321883ef69804066ccdc90e3ca1c63ca0f7bcd0c /arch/h8300 | |
parent | d396360acdf7e57edcd9e2d080343b0353d65d63 (diff) | |
parent | 6edd1dbace0e8529ed167e8a5f9da63c0cc763cc (diff) | |
download | linux-stable-27ebbf9d5bc0ab0a8ca875119e0ce4cd267fa2fc.tar.gz linux-stable-27ebbf9d5bc0ab0a8ca875119e0ce4cd267fa2fc.tar.bz2 linux-stable-27ebbf9d5bc0ab0a8ca875119e0ce4cd267fa2fc.zip |
Merge tag 'asm-generic-nommu' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic
Pull nommu generic uaccess updates from Arnd Bergmann:
"asm-generic: kill <asm/segment.h> and improve nommu generic uaccess helpers
Christoph Hellwig writes:
This is a series doing two somewhat interwinded things. It improves
the asm-generic nommu uaccess helper to optionally be entirely
generic and not require any arch helpers for the actual uaccess.
For the generic uaccess.h to actually be generically useful I also
had to kill off the mess we made of <asm/segment.h>, which really
shouldn't exist on most architectures"
* tag 'asm-generic-nommu' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
asm-generic: optimize generic uaccess for 8-byte loads and stores
asm-generic: provide entirely generic nommu uaccess
arch: mostly remove <asm/segment.h>
asm-generic: don't include <asm/segment.h> from <asm/uaccess.h>
Diffstat (limited to 'arch/h8300')
-rw-r--r-- | arch/h8300/Kconfig | 1 | ||||
-rw-r--r-- | arch/h8300/include/asm/Kbuild | 1 | ||||
-rw-r--r-- | arch/h8300/include/asm/uaccess.h | 55 |
3 files changed, 2 insertions, 55 deletions
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig index 61c01db6c292..ecfc4b4b6373 100644 --- a/arch/h8300/Kconfig +++ b/arch/h8300/Kconfig @@ -23,6 +23,7 @@ config H8300 select HAVE_ARCH_KGDB select HAVE_ARCH_HASH select CPU_NO_EFFICIENT_FFS + select UACCESS_MEMCPY config CPU_BIG_ENDIAN def_bool y diff --git a/arch/h8300/include/asm/Kbuild b/arch/h8300/include/asm/Kbuild index f2e22058e488..79cd1e605ec4 100644 --- a/arch/h8300/include/asm/Kbuild +++ b/arch/h8300/include/asm/Kbuild @@ -47,6 +47,7 @@ generic-y += timex.h generic-y += tlbflush.h generic-y += topology.h generic-y += trace_clock.h +generic-y += uaccess.h generic-y += unaligned.h generic-y += vga.h generic-y += word-at-a-time.h diff --git a/arch/h8300/include/asm/uaccess.h b/arch/h8300/include/asm/uaccess.h deleted file mode 100644 index bc8031949d07..000000000000 --- a/arch/h8300/include/asm/uaccess.h +++ /dev/null @@ -1,55 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_UACCESS_H -#define _ASM_UACCESS_H - -#include <linux/string.h> - -static inline __must_check unsigned long -raw_copy_from_user(void *to, const void __user * from, unsigned long n) -{ - if (__builtin_constant_p(n)) { - switch(n) { - case 1: - *(u8 *)to = *(u8 __force *)from; - return 0; - case 2: - *(u16 *)to = *(u16 __force *)from; - return 0; - case 4: - *(u32 *)to = *(u32 __force *)from; - return 0; - } - } - - memcpy(to, (const void __force *)from, n); - return 0; -} - -static inline __must_check unsigned long -raw_copy_to_user(void __user *to, const void *from, unsigned long n) -{ - if (__builtin_constant_p(n)) { - switch(n) { - case 1: - *(u8 __force *)to = *(u8 *)from; - return 0; - case 2: - *(u16 __force *)to = *(u16 *)from; - return 0; - case 4: - *(u32 __force *)to = *(u32 *)from; - return 0; - default: - break; - } - } - - memcpy((void __force *)to, from, n); - return 0; -} -#define INLINE_COPY_FROM_USER -#define INLINE_COPY_TO_USER - -#include <asm-generic/uaccess.h> - -#endif |