summaryrefslogtreecommitdiff
path: root/disk
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2018-06-09 17:50:18 +0200
committerAlexander Graf <agraf@suse.de>2018-06-14 10:52:14 +0200
commit44ab2d325b79d3ce6123495c5ce52410655a58fb (patch)
tree195bbf19af1d7168d048e4404584e840dde099fc /disk
parent2d2b5b2d007769ba48fd31223997df1d6b662c78 (diff)
efi_loader: avoid initializer element is not constant
When building with -pedantic the current definition of EFI_GUID() causes an error 'initializer element is not constant'. Currently EFI_GUID() is used both as an anonymous constant and as an intializer. A conversion to efi_guid_t is not allowable when using EFI_GUID() as an initializer. But it is needed when using it as an anonymous constant. We should not use EFI_GUID() for anything but an initializer. So let's introduce a variable where needed and remove the conversion. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'disk')
-rw-r--r--disk/part_efi.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/disk/part_efi.c b/disk/part_efi.c
index 5c1039f013..2945892a24 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -23,6 +23,11 @@
DECLARE_GLOBAL_DATA_PTR;
+/*
+ * GUID for basic data partions.
+ */
+static const efi_guid_t partition_basic_data_guid = PARTITION_BASIC_DATA_GUID;
+
#ifdef CONFIG_HAVE_BLOCK_DEVICE
/**
* efi_crc32() - EFI version of crc32 function
@@ -502,12 +507,12 @@ int gpt_fill_pte(struct blk_desc *dev_desc,
} else {
/* default partition type GUID */
memcpy(bin_type_guid,
- &PARTITION_BASIC_DATA_GUID, 16);
+ &partition_basic_data_guid, 16);
}
#else
/* partition type GUID */
memcpy(gpt_e[i].partition_type_guid.b,
- &PARTITION_BASIC_DATA_GUID, 16);
+ &partition_basic_data_guid, 16);
#endif
#if CONFIG_IS_ENABLED(PARTITION_UUIDS)