summaryrefslogtreecommitdiff
path: root/disk
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-07-02 12:36:14 -0600
committerTom Rini <trini@konsulko.com>2021-07-28 14:27:54 -0400
commita594b41f86d516cff80b335a0d0b72a2647a7829 (patch)
tree59c5a6f830768d728cce3ea83d7bdcff3227eef9 /disk
parentc72c7d9db5ff9e5e88de6d23a2ec0a745707f6fe (diff)
disk: Tidy up #ifdefs in part_efi
This file does not correctly handle the various cases, sometimes producing warnings about partition_basic_data_guid being defined but not used. Fix it. There was some discussion about adjusting Kconfig or making HAVE_BLOCK_DEVICE a prerequisite for PARTITIONS, but apparently this is not feasible. Such changes can be undertaken separate from the goal of this series. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'disk')
-rw-r--r--disk/part_efi.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/disk/part_efi.c b/disk/part_efi.c
index 0fb7ff0b6b..fdca91a697 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -29,12 +29,13 @@
DECLARE_GLOBAL_DATA_PTR;
-/*
- * GUID for basic data partions.
- */
+#ifdef CONFIG_HAVE_BLOCK_DEVICE
+
+/* GUID for basic data partitons */
+#if CONFIG_IS_ENABLED(EFI_PARTITION)
static const efi_guid_t partition_basic_data_guid = PARTITION_BASIC_DATA_GUID;
+#endif
-#ifdef CONFIG_HAVE_BLOCK_DEVICE
/**
* efi_crc32() - EFI version of crc32 function
* @buf: buffer to calculate crc32 of
@@ -1126,4 +1127,4 @@ U_BOOT_PART_TYPE(a_efi) = {
.print = part_print_ptr(part_print_efi),
.test = part_test_efi,
};
-#endif
+#endif /* CONFIG_HAVE_BLOCK_DEVICE */