From 5b467269bed56823f44ebeb1fe0ec2a782e8b05e Mon Sep 17 00:00:00 2001 From: "Li, Fei1" Date: Mon, 17 Dec 2018 23:32:57 +0800 Subject: [PATCH] hv: lib: remove memchr No one uses it and it's some duplicated with strchr. Tracked-On: #861 Signed-off-by: Li, Fei1 Acked-by: Anthony Xu --- hypervisor/include/lib/rtl.h | 1 - hypervisor/lib/memory.c | 15 --------------- 2 files changed, 16 deletions(-) diff --git a/hypervisor/include/lib/rtl.h b/hypervisor/include/lib/rtl.h index c22fd36aa..a5d5abb3c 100644 --- a/hypervisor/include/lib/rtl.h +++ b/hypervisor/include/lib/rtl.h @@ -21,7 +21,6 @@ union u_qword { /* Function prototypes */ void udelay(uint32_t us); -void *memchr(const void *void_s, int32_t c, size_t n); int32_t strcmp(const char *s1_arg, const char *s2_arg); int32_t strncmp(const char *s1_arg, const char *s2_arg, size_t n_arg); char *strncpy_s(char *d_arg, size_t dmax, const char *s_arg, size_t slen_arg); diff --git a/hypervisor/lib/memory.c b/hypervisor/lib/memory.c index 9ee65a1a8..4f6bc7c60 100644 --- a/hypervisor/lib/memory.c +++ b/hypervisor/lib/memory.c @@ -259,21 +259,6 @@ void free(const void *ptr) } } -void *memchr(const void *void_s, int32_t c, size_t n) -{ - uint8_t val = (uint8_t)c; - uint8_t *ptr = (uint8_t *)void_s; - uint8_t *end = ptr + n; - - while (ptr < end) { - if (*ptr == val) { - return ((void *)ptr); - } - ptr++; - } - return NULL; -} - static inline void memcpy_erms(void *d, const void *s, size_t slen) { asm volatile ("rep; movsb"