qed: Fix static checker warning
[linux/fpc-iii.git] / tools / perf / bench / mem-memcpy-x86-64-lib.c
blob4130734dde84b2ed8ce36199202ee0e91308bb0a
1 /*
2 * From code in arch/x86/lib/usercopy_64.c, copied to keep tools/ copy
3 * of the kernel's arch/x86/lib/memcpy_64.s used in 'perf bench mem memcpy'
4 * happy.
5 */
6 #include <linux/types.h>
8 unsigned long __memcpy_mcsafe(void *dst, const void *src, size_t cnt);
9 unsigned long mcsafe_handle_tail(char *to, char *from, unsigned len);
11 unsigned long mcsafe_handle_tail(char *to, char *from, unsigned len)
13 for (; len; --len, to++, from++) {
15 * Call the assembly routine back directly since
16 * memcpy_mcsafe() may silently fallback to memcpy.
18 unsigned long rem = __memcpy_mcsafe(to, from, 1);
20 if (rem)
21 break;
23 return len;