Commit bc61614d authored by Ammar Faizi's avatar Ammar Faizi Committed by Thomas Weißschuh

tools/nolibc: string: Remove the `_nolibc_memcpy_up()` function

This function is only called by memcpy(), there is no real reason to
have this wrapper. Delete this function and move the code to memcpy()
directly.
Signed-off-by: default avatarAmmar Faizi <ammarfaizi2@gnuweeb.org>
Reviewed-by: default avatarAlviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
parent 5dfc79b2
......@@ -27,18 +27,6 @@ int memcmp(const void *s1, const void *s2, size_t n)
return c1;
}
static __attribute__((unused))
void *_nolibc_memcpy_up(void *dst, const void *src, size_t len)
{
size_t pos = 0;
while (pos < len) {
((char *)dst)[pos] = ((const char *)src)[pos];
pos++;
}
return dst;
}
#ifndef NOLIBC_ARCH_HAS_MEMMOVE
/* might be ignored by the compiler without -ffreestanding, then found as
* missing.
......@@ -70,7 +58,13 @@ void *memmove(void *dst, const void *src, size_t len)
__attribute__((weak,unused,section(".text.nolibc_memcpy")))
void *memcpy(void *dst, const void *src, size_t len)
{
return _nolibc_memcpy_up(dst, src, len);
size_t pos = 0;
while (pos < len) {
((char *)dst)[pos] = ((const char *)src)[pos];
pos++;
}
return dst;
}
#endif /* #ifndef NOLIBC_ARCH_HAS_MEMCPY */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment