cleanup: grub_cpu_to_XXX_compile_time for constants
This tries to catch all cases where grub_cpu_to_XXX was used for constant expressions (including sizeof).
This commit is contained in:
parent
6d05b6383c
commit
954fe77163
26 changed files with 98 additions and 93 deletions
|
@ -25,8 +25,8 @@
|
|||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
#define LINUX_NATIVE_MAGIC grub_cpu_to_le32 (0xdeafa1de)
|
||||
#define LINUX_SWAP_MAGIC grub_cpu_to_le32 (0xdeafab1e)
|
||||
#define LINUX_NATIVE_MAGIC grub_cpu_to_le32_compile_time (0xdeafa1de)
|
||||
#define LINUX_SWAP_MAGIC grub_cpu_to_le32_compile_time (0xdeafab1e)
|
||||
#define LINUX_MAP_ENTRIES (512 / 12)
|
||||
|
||||
#define NONADFS_PARTITION_TYPE_LINUX 9
|
||||
|
|
|
@ -53,7 +53,7 @@ iterate_real (grub_disk_t disk, grub_disk_addr_t sector, int freebsd,
|
|||
return grub_errno;
|
||||
|
||||
/* Check if it is valid. */
|
||||
if (label.magic != grub_cpu_to_le32 (GRUB_PC_PARTITION_BSD_LABEL_MAGIC))
|
||||
if (label.magic != grub_cpu_to_le32_compile_time (GRUB_PC_PARTITION_BSD_LABEL_MAGIC))
|
||||
return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature");
|
||||
|
||||
/* A kludge to determine a base of be.offset. */
|
||||
|
|
|
@ -65,7 +65,7 @@ grub_gpt_partition_map_iterate (grub_disk_t disk,
|
|||
return grub_errno;
|
||||
|
||||
/* Check if it is valid. */
|
||||
if (mbr.signature != grub_cpu_to_le16 (GRUB_PC_PARTITION_SIGNATURE))
|
||||
if (mbr.signature != grub_cpu_to_le16_compile_time (GRUB_PC_PARTITION_SIGNATURE))
|
||||
return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature");
|
||||
|
||||
/* Make sure the MBR is a protective MBR and not a normal MBR. */
|
||||
|
|
|
@ -162,7 +162,7 @@ grub_partition_msdos_iterate (grub_disk_t disk,
|
|||
lastaddr = p.offset;
|
||||
|
||||
/* Check if it is valid. */
|
||||
if (mbr.signature != grub_cpu_to_le16 (GRUB_PC_PARTITION_SIGNATURE))
|
||||
if (mbr.signature != grub_cpu_to_le16_compile_time (GRUB_PC_PARTITION_SIGNATURE))
|
||||
return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature");
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
|
@ -280,7 +280,7 @@ pc_partition_map_embed (struct grub_disk *disk, unsigned int *nsectors,
|
|||
lastaddr = offset;
|
||||
|
||||
/* Check if it is valid. */
|
||||
if (mbr.signature != grub_cpu_to_le16 (GRUB_PC_PARTITION_SIGNATURE))
|
||||
if (mbr.signature != grub_cpu_to_le16_compile_time (GRUB_PC_PARTITION_SIGNATURE))
|
||||
return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature");
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue