Skip to content

Commit 986fd3e

Browse files
committed
boot: Remove unused memmem_safe
1 parent f7bc0fb commit 986fd3e

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

src/boot/efi/util.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -505,20 +505,6 @@ EFI_STATUS log_oom(void) {
505505
return EFI_OUT_OF_RESOURCES;
506506
}
507507

508-
void *memmem_safe(const void *haystack, UINTN haystack_len, const void *needle, UINTN needle_len) {
509-
assert(haystack || haystack_len == 0);
510-
assert(needle || needle_len == 0);
511-
512-
if (needle_len == 0)
513-
return (void*)haystack;
514-
515-
for (const CHAR8 *h = haystack, *n = needle; haystack_len >= needle_len; h++, haystack_len--)
516-
if (*h == *n && CompareMem(h + 1, n + 1, needle_len - 1) == 0)
517-
return (void*)h;
518-
519-
return NULL;
520-
}
521-
522508
void print_at(UINTN x, UINTN y, UINTN attr, const CHAR16 *str) {
523509
assert(str);
524510
ST->ConOut->SetCursorPosition(ST->ConOut, x, y);

src/boot/efi/util.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,6 @@ EFI_STATUS log_oom(void);
111111
err; \
112112
})
113113

114-
void *memmem_safe(const void *haystack, UINTN haystack_len, const void *needle, UINTN needle_len);
115-
116-
static inline void *mempmem_safe(const void *haystack, UINTN haystack_len, const void *needle, UINTN needle_len) {
117-
CHAR8 *p = memmem_safe(haystack, haystack_len, needle, needle_len);
118-
return p ? p + needle_len : NULL;
119-
}
120-
121114
void print_at(UINTN x, UINTN y, UINTN attr, const CHAR16 *str);
122115
void clear_screen(UINTN attr);
123116

0 commit comments

Comments
 (0)