From 0692f533f237da11ddd2da69ff91b9c052fdb77c Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Tue, 12 Jul 2022 10:01:03 +0200 Subject: [PATCH] bcd: Clean up includes Also, now that bcd.h does not depend on efi.h anymore we can now properly include it in the test instead. --- src/boot/efi/bcd.c | 15 +++------------ src/boot/efi/test-bcd.c | 1 + 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/boot/efi/bcd.c b/src/boot/efi/bcd.c index 730173b911..7200012c0a 100644 --- a/src/boot/efi/bcd.c +++ b/src/boot/efi/bcd.c @@ -1,18 +1,9 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #include -#ifdef SD_BOOT -# include -# include "macro-fundamental.h" -# include "util.h" -# define TEST_STATIC -#else -/* Provide our own "EFI API" if we are running as a unit test. */ -# include "efi-string.h" -# include "string-util-fundamental.h" -# define TEST_STATIC static -#endif +#include "bcd.h" +#include "efi-string.h" enum { SIG_BASE_BLOCK = 1718052210, /* regf */ @@ -227,7 +218,7 @@ static const KeyValue *get_key_value(const uint8_t *bcd, uint32_t bcd_len, const * (it always has the GUID 9dea862c-5cdd-4e70-acc1-f32b344d4795). If it contains more than * one GUID, the BCD is multi-boot and we stop looking. Otherwise we take that GUID, look it * up, and return its description property. */ -TEST_STATIC char16_t *get_bcd_title(uint8_t *bcd, size_t bcd_len) { +char16_t *get_bcd_title(uint8_t *bcd, size_t bcd_len) { assert(bcd); if (HIVE_CELL_OFFSET >= bcd_len) diff --git a/src/boot/efi/test-bcd.c b/src/boot/efi/test-bcd.c index d04d1ee45a..0ee2947704 100644 --- a/src/boot/efi/test-bcd.c +++ b/src/boot/efi/test-bcd.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #include "alloc-util.h" +#include "bcd.h" #include "compress.h" #include "fileio.h" #include "tests.h"