1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-03 01:17:45 +03:00

boot: Remove unused memmem_safe

This commit is contained in:
Jan Janssen 2021-12-02 13:16:33 +01:00
parent f7bc0fb35b
commit 986fd3ebc2
2 changed files with 0 additions and 21 deletions

View 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);

View 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);