On 6/28/21 3:48 AM, Simon Glass wrote:
This file does not correctly handle the various cases, sometimes
producing warnings about partition_basic_data_guid being defined but not
used. Fix it.

Signed-off-by: Simon Glass <s...@chromium.org>
---

  disk/part_efi.c | 11 ++++++-----
  1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/disk/part_efi.c b/disk/part_efi.c
index 0fb7ff0b6bb..fdca91a6974 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

This #ifdef should be removed. Make CONFIG_HAVE_BLOCK_DEVICE a
prerequisite for CONFIG_PARTITIONS instead.

+
+/* GUID for basic data partitons */
+#if CONFIG_IS_ENABLED(EFI_PARTITION)

part_efi.c is not compiled without CONFIG_$(SPL_)EFI_PARTITION=y. Why
put an #if on EFI_PARTITION here?

Best regards

Heinrich

  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 */


Reply via email to