mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
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>
This commit is contained in:

committed by
Alexander Graf

parent
2d2b5b2d00
commit
44ab2d325b
@ -23,6 +23,11 @@
|
|||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
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
|
#ifdef CONFIG_HAVE_BLOCK_DEVICE
|
||||||
/**
|
/**
|
||||||
* efi_crc32() - EFI version of crc32 function
|
* efi_crc32() - EFI version of crc32 function
|
||||||
@ -502,12 +507,12 @@ int gpt_fill_pte(struct blk_desc *dev_desc,
|
|||||||
} else {
|
} else {
|
||||||
/* default partition type GUID */
|
/* default partition type GUID */
|
||||||
memcpy(bin_type_guid,
|
memcpy(bin_type_guid,
|
||||||
&PARTITION_BASIC_DATA_GUID, 16);
|
&partition_basic_data_guid, 16);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
/* partition type GUID */
|
/* partition type GUID */
|
||||||
memcpy(gpt_e[i].partition_type_guid.b,
|
memcpy(gpt_e[i].partition_type_guid.b,
|
||||||
&PARTITION_BASIC_DATA_GUID, 16);
|
&partition_basic_data_guid, 16);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_IS_ENABLED(PARTITION_UUIDS)
|
#if CONFIG_IS_ENABLED(PARTITION_UUIDS)
|
||||||
|
@ -89,12 +89,11 @@ typedef u64 efi_virtual_addr_t;
|
|||||||
typedef void *efi_handle_t;
|
typedef void *efi_handle_t;
|
||||||
|
|
||||||
#define EFI_GUID(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
|
#define EFI_GUID(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
|
||||||
((efi_guid_t) \
|
|
||||||
{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, \
|
{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, \
|
||||||
((a) >> 24) & 0xff, \
|
((a) >> 24) & 0xff, \
|
||||||
(b) & 0xff, ((b) >> 8) & 0xff, \
|
(b) & 0xff, ((b) >> 8) & 0xff, \
|
||||||
(c) & 0xff, ((c) >> 8) & 0xff, \
|
(c) & 0xff, ((c) >> 8) & 0xff, \
|
||||||
(d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) } })
|
(d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) } }
|
||||||
|
|
||||||
/* Generic EFI table header */
|
/* Generic EFI table header */
|
||||||
struct efi_table_hdr {
|
struct efi_table_hdr {
|
||||||
|
Reference in New Issue
Block a user