vfs: Make __vfs_write() static
[linux/fpc-iii.git] / arch / h8300 / include / asm / uaccess.h
blobbc8031949d07b3de3653939e71425100ed7482bd
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_UACCESS_H
3 #define _ASM_UACCESS_H
5 #include <linux/string.h>
7 static inline __must_check unsigned long
8 raw_copy_from_user(void *to, const void __user * from, unsigned long n)
10 if (__builtin_constant_p(n)) {
11 switch(n) {
12 case 1:
13 *(u8 *)to = *(u8 __force *)from;
14 return 0;
15 case 2:
16 *(u16 *)to = *(u16 __force *)from;
17 return 0;
18 case 4:
19 *(u32 *)to = *(u32 __force *)from;
20 return 0;
24 memcpy(to, (const void __force *)from, n);
25 return 0;
28 static inline __must_check unsigned long
29 raw_copy_to_user(void __user *to, const void *from, unsigned long n)
31 if (__builtin_constant_p(n)) {
32 switch(n) {
33 case 1:
34 *(u8 __force *)to = *(u8 *)from;
35 return 0;
36 case 2:
37 *(u16 __force *)to = *(u16 *)from;
38 return 0;
39 case 4:
40 *(u32 __force *)to = *(u32 *)from;
41 return 0;
42 default:
43 break;
47 memcpy((void __force *)to, from, n);
48 return 0;
50 #define INLINE_COPY_FROM_USER
51 #define INLINE_COPY_TO_USER
53 #include <asm-generic/uaccess.h>
55 #endif