.. | .. |
---|
23 | 23 | static __always_inline unsigned long |
---|
24 | 24 | raw_copy_from_user(void *to, const void __user *from, unsigned long n) |
---|
25 | 25 | { |
---|
26 | | - if (__builtin_constant_p(n)) { |
---|
27 | | - unsigned long ret; |
---|
28 | | - |
---|
29 | | - switch (n) { |
---|
30 | | - case 1: |
---|
31 | | - ret = 0; |
---|
32 | | - __uaccess_begin_nospec(); |
---|
33 | | - __get_user_asm_nozero(*(u8 *)to, from, ret, |
---|
34 | | - "b", "b", "=q", 1); |
---|
35 | | - __uaccess_end(); |
---|
36 | | - return ret; |
---|
37 | | - case 2: |
---|
38 | | - ret = 0; |
---|
39 | | - __uaccess_begin_nospec(); |
---|
40 | | - __get_user_asm_nozero(*(u16 *)to, from, ret, |
---|
41 | | - "w", "w", "=r", 2); |
---|
42 | | - __uaccess_end(); |
---|
43 | | - return ret; |
---|
44 | | - case 4: |
---|
45 | | - ret = 0; |
---|
46 | | - __uaccess_begin_nospec(); |
---|
47 | | - __get_user_asm_nozero(*(u32 *)to, from, ret, |
---|
48 | | - "l", "k", "=r", 4); |
---|
49 | | - __uaccess_end(); |
---|
50 | | - return ret; |
---|
51 | | - } |
---|
52 | | - } |
---|
53 | 26 | return __copy_user_ll(to, (__force const void *)from, n); |
---|
54 | 27 | } |
---|
55 | 28 | |
---|