]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bcd: Clean up includes 23982/head
authorJan Janssen <medhefgo@web.de>
Tue, 12 Jul 2022 08:01:03 +0000 (10:01 +0200)
committerJan Janssen <medhefgo@web.de>
Tue, 12 Jul 2022 09:29:59 +0000 (11:29 +0200)
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
src/boot/efi/test-bcd.c

index 730173b9118f1fb6de9feebb5df422273ca74027..7200012c0a722d84fa53970280913b3d28d1a6a2 100644 (file)
@@ -1,18 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <stdalign.h>
-#ifdef SD_BOOT
-#  include <efi.h>
-#  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)
index d04d1ee45a0b25f10ffa1d4426fa78a6859b92d7..0ee29477040827453f09d76abc6fea558476d894 100644 (file)
@@ -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"