Avoid using tricks for initialising endian variables.
* grub-core/partmap/gpt.c (grub_gpt_partition_type_bios_boot): Make const. (GRUB_MOD_INIT): Don't byte-swap. * include/grub/gpt_partition.h (GRUB_GPT_PARTITION_TYPE_BIOS_BOOT): Use grub_cpu_to_le16_compile_time and grub_cpu_to_le32_compile_time. * include/grub/types.h (grub_swap_bytes16_compile_time): New macro. (grub_swap_bytes32_compile_time): Likewise. (grub_cpu_to_le32_compile_time): Likewise. (grub_cpu_to_le16_compile_time): Likewise.
This commit is contained in:
parent
f420a80458
commit
49d3ab4668
4 changed files with 23 additions and 10 deletions
|
@ -33,7 +33,7 @@ static grub_uint8_t grub_gpt_magic[8] =
|
|||
static const grub_gpt_part_type_t grub_gpt_partition_type_empty = GRUB_GPT_PARTITION_TYPE_EMPTY;
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
static grub_gpt_part_type_t grub_gpt_partition_type_bios_boot = GRUB_GPT_PARTITION_TYPE_BIOS_BOOT;
|
||||
static const grub_gpt_part_type_t grub_gpt_partition_type_bios_boot = GRUB_GPT_PARTITION_TYPE_BIOS_BOOT;
|
||||
#endif
|
||||
|
||||
/* 512 << 7 = 65536 byte sectors. */
|
||||
|
@ -198,14 +198,6 @@ static struct grub_partition_map grub_gpt_partition_map =
|
|||
GRUB_MOD_INIT(part_gpt)
|
||||
{
|
||||
grub_partition_map_register (&grub_gpt_partition_map);
|
||||
#ifdef GRUB_UTIL
|
||||
grub_gpt_partition_type_bios_boot.data1 =
|
||||
grub_cpu_to_le32 (grub_gpt_partition_type_bios_boot.data1);
|
||||
grub_gpt_partition_type_bios_boot.data2 =
|
||||
grub_cpu_to_le16 (grub_gpt_partition_type_bios_boot.data2);
|
||||
grub_gpt_partition_type_bios_boot.data3 =
|
||||
grub_cpu_to_le16 (grub_gpt_partition_type_bios_boot.data3);
|
||||
#endif
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(part_gpt)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue