aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmmar Faizi <ammarfaizi2@gnuweeb.org>2023-09-02 20:35:05 +0700
committerWilly Tarreau <w@1wt.eu>2023-09-03 11:49:04 +0200
commitf7a6e4791e3d685eddca29b5d16d183ee0407caa (patch)
treea7a4d3192f609ed7f4eaad5d7e3182c7d89398e1
parentfafb3a6c05f3787499d280e671928b2524bdc0b6 (diff)
downloadnolibc-next.tar.gz
tools/nolibc: string: Remove the `_nolibc_memcpy_up()` functionnext
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: Ammar Faizi <ammarfaizi2@gnuweeb.org> Reviewed-by: Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org> Signed-off-by: Willy Tarreau <w@1wt.eu>
-rw-r--r--tools/include/nolibc/string.h20
1 files changed, 7 insertions, 13 deletions
diff --git a/tools/include/nolibc/string.h b/tools/include/nolibc/string.h
index 22dcb3f566baee..a01c69dd495f55 100644
--- a/tools/include/nolibc/string.h
+++ b/tools/include/nolibc/string.h
@@ -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 */