|
30 | 30 | #include <linux/compiler.h> |
31 | 31 | #include <linux/string.h> |
32 | 32 |
|
33 | | -#ifdef __HAVE_ARCH_MEMMOVE |
34 | | -#ifndef CONFIG_OPT_LIB_FUNCTION |
35 | | -void *memmove(void *v_dst, const void *v_src, __kernel_size_t c) |
36 | | -{ |
37 | | - const char *src = v_src; |
38 | | - char *dst = v_dst; |
39 | | - |
40 | | - if (!c) |
41 | | - return v_dst; |
42 | | - |
43 | | - /* Use memcpy when source is higher than dest */ |
44 | | - if (v_dst <= v_src) |
45 | | - return memcpy(v_dst, v_src, c); |
46 | | - |
47 | | - /* copy backwards, from end to beginning */ |
48 | | - src += c; |
49 | | - dst += c; |
50 | | - |
51 | | - /* Simple, byte oriented memmove. */ |
52 | | - while (c--) |
53 | | - *--dst = *--src; |
54 | | - |
55 | | - return v_dst; |
56 | | -} |
57 | | -#else /* CONFIG_OPT_LIB_FUNCTION */ |
| 33 | +#ifdef CONFIG_OPT_LIB_FUNCTION |
58 | 34 | void *memmove(void *v_dst, const void *v_src, __kernel_size_t c) |
59 | 35 | { |
60 | 36 | const char *src = v_src; |
@@ -102,7 +78,7 @@ void *memmove(void *v_dst, const void *v_src, __kernel_size_t c) |
102 | 78 |
|
103 | 79 | i_dst = (void *)dst; |
104 | 80 | /* Choose a copy scheme based on the source */ |
105 | | - /* alignment relative to dstination. */ |
| 81 | + /* alignment relative to destination. */ |
106 | 82 | switch ((unsigned long)src & 3) { |
107 | 83 | case 0x0: /* Both byte offsets are aligned */ |
108 | 84 |
|
@@ -215,6 +191,5 @@ void *memmove(void *v_dst, const void *v_src, __kernel_size_t c) |
215 | 191 | } |
216 | 192 | return v_dst; |
217 | 193 | } |
218 | | -#endif /* CONFIG_OPT_LIB_FUNCTION */ |
219 | 194 | EXPORT_SYMBOL(memmove); |
220 | | -#endif /* __HAVE_ARCH_MEMMOVE */ |
| 195 | +#endif /* CONFIG_OPT_LIB_FUNCTION */ |
0 commit comments