Skip to content

Commit bc61614

Browse files
ammarfaizi2t-8ch
authored andcommitted
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: Ammar Faizi <[email protected]> Reviewed-by: Alviro Iskandar Setiawan <[email protected]> Signed-off-by: Willy Tarreau <[email protected]> Signed-off-by: Thomas Weißschuh <[email protected]>
1 parent 5dfc79b commit bc61614

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

tools/include/nolibc/string.h

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,6 @@ int memcmp(const void *s1, const void *s2, size_t n)
2727
return c1;
2828
}
2929

30-
static __attribute__((unused))
31-
void *_nolibc_memcpy_up(void *dst, const void *src, size_t len)
32-
{
33-
size_t pos = 0;
34-
35-
while (pos < len) {
36-
((char *)dst)[pos] = ((const char *)src)[pos];
37-
pos++;
38-
}
39-
return dst;
40-
}
41-
4230
#ifndef NOLIBC_ARCH_HAS_MEMMOVE
4331
/* might be ignored by the compiler without -ffreestanding, then found as
4432
* missing.
@@ -70,7 +58,13 @@ void *memmove(void *dst, const void *src, size_t len)
7058
__attribute__((weak,unused,section(".text.nolibc_memcpy")))
7159
void *memcpy(void *dst, const void *src, size_t len)
7260
{
73-
return _nolibc_memcpy_up(dst, src, len);
61+
size_t pos = 0;
62+
63+
while (pos < len) {
64+
((char *)dst)[pos] = ((const char *)src)[pos];
65+
pos++;
66+
}
67+
return dst;
7468
}
7569
#endif /* #ifndef NOLIBC_ARCH_HAS_MEMCPY */
7670

0 commit comments

Comments
 (0)