boot: Remove unused memmem_safe
authorJan Janssen <medhefgo@web.de>
Thu, 2 Dec 2021 12:16:33 +0000 (13:16 +0100)
committerJan Janssen <medhefgo@web.de>
Sat, 11 Dec 2021 20:32:29 +0000 (21:32 +0100)
src/boot/efi/util.c
src/boot/efi/util.h

index c59829b46dcfe90d8686462505b1247689d9e6a0..6db4ab39695156aadaf7aea92c8cacada65e2d50 100644 (file)
@@ -505,20 +505,6 @@ EFI_STATUS log_oom(void) {
         return EFI_OUT_OF_RESOURCES;
 }
 
-void *memmem_safe(const void *haystack, UINTN haystack_len, const void *needle, UINTN needle_len) {
-        assert(haystack || haystack_len == 0);
-        assert(needle || needle_len == 0);
-
-        if (needle_len == 0)
-                return (void*)haystack;
-
-        for (const CHAR8 *h = haystack, *n = needle; haystack_len >= needle_len; h++, haystack_len--)
-                if (*h == *n && CompareMem(h + 1, n + 1, needle_len - 1) == 0)
-                        return (void*)h;
-
-        return NULL;
-}
-
 void print_at(UINTN x, UINTN y, UINTN attr, const CHAR16 *str) {
         assert(str);
         ST->ConOut->SetCursorPosition(ST->ConOut, x, y);
index 853885611ebc5e60d46f5fb8313bc9bb4ec82287..b40f05eaef09b3d4554a4b6bf4838bfb93dc8ec6 100644 (file)
@@ -111,13 +111,6 @@ EFI_STATUS log_oom(void);
                 err; \
         })
 
-void *memmem_safe(const void *haystack, UINTN haystack_len, const void *needle, UINTN needle_len);
-
-static inline void *mempmem_safe(const void *haystack, UINTN haystack_len, const void *needle, UINTN needle_len) {
-        CHAR8 *p = memmem_safe(haystack, haystack_len, needle, needle_len);
-        return p ? p + needle_len : NULL;
-}
-
 void print_at(UINTN x, UINTN y, UINTN attr, const CHAR16 *str);
 void clear_screen(UINTN attr);