Skip to content

Commit 5b46726

Browse files
lifeixwenlingz
authored andcommitted
hv: lib: remove memchr
No one uses it and it's some duplicated with strchr. Tracked-On: #861 Signed-off-by: Li, Fei1 <fei1.li@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
1 parent 97132ac commit 5b46726

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

hypervisor/include/lib/rtl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ union u_qword {
2121

2222
/* Function prototypes */
2323
void udelay(uint32_t us);
24-
void *memchr(const void *void_s, int32_t c, size_t n);
2524
int32_t strcmp(const char *s1_arg, const char *s2_arg);
2625
int32_t strncmp(const char *s1_arg, const char *s2_arg, size_t n_arg);
2726
char *strncpy_s(char *d_arg, size_t dmax, const char *s_arg, size_t slen_arg);

hypervisor/lib/memory.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -259,21 +259,6 @@ void free(const void *ptr)
259259
}
260260
}
261261

262-
void *memchr(const void *void_s, int32_t c, size_t n)
263-
{
264-
uint8_t val = (uint8_t)c;
265-
uint8_t *ptr = (uint8_t *)void_s;
266-
uint8_t *end = ptr + n;
267-
268-
while (ptr < end) {
269-
if (*ptr == val) {
270-
return ((void *)ptr);
271-
}
272-
ptr++;
273-
}
274-
return NULL;
275-
}
276-
277262
static inline void memcpy_erms(void *d, const void *s, size_t slen)
278263
{
279264
asm volatile ("rep; movsb"

0 commit comments

Comments
 (0)