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
|
@ -164,10 +164,10 @@ static int add_subnode (void *fdt, int parentoffset, const char *name)
|
|||
insert:
|
||||
grub_memmove (token + entry_size / sizeof(*token), token,
|
||||
(grub_addr_t) end - (grub_addr_t) token);
|
||||
*token = grub_cpu_to_be32(FDT_BEGIN_NODE);
|
||||
*token = grub_cpu_to_be32_compile_time(FDT_BEGIN_NODE);
|
||||
token[entry_size / sizeof(*token) - 2] = 0; /* padding bytes */
|
||||
grub_strcpy((char *) (token + 1), name);
|
||||
token[entry_size / sizeof(*token) - 1] = grub_cpu_to_be32(FDT_END_NODE);
|
||||
token[entry_size / sizeof(*token) - 1] = grub_cpu_to_be32_compile_time(FDT_END_NODE);
|
||||
grub_fdt_set_size_dt_struct (fdt, struct_size + entry_size);
|
||||
return ((grub_addr_t) token - (grub_addr_t) fdt
|
||||
- grub_fdt_get_off_dt_struct(fdt));
|
||||
|
@ -377,7 +377,7 @@ int grub_fdt_set_prop (void *fdt, unsigned int nodeoffset, const char *name,
|
|||
|
||||
prop_name_present = 1;
|
||||
for (i = 0; i < prop_len / sizeof(grub_uint32_t); i++)
|
||||
*(prop + 3 + i) = grub_cpu_to_be32 (FDT_NOP);
|
||||
*(prop + 3 + i) = grub_cpu_to_be32_compile_time (FDT_NOP);
|
||||
if (len > ALIGN_UP(prop_len, sizeof(grub_uint32_t)))
|
||||
{
|
||||
/* Length of new property value is greater than the space allocated
|
||||
|
@ -385,7 +385,7 @@ int grub_fdt_set_prop (void *fdt, unsigned int nodeoffset, const char *name,
|
|||
nameoff field of the current entry and replace the current entry
|
||||
with NOP tokens. */
|
||||
nameoff = grub_be_to_cpu32 (*(prop + 2));
|
||||
*prop = *(prop + 1) = *(prop + 2) = grub_cpu_to_be32 (FDT_NOP);
|
||||
*prop = *(prop + 1) = *(prop + 2) = grub_cpu_to_be32_compile_time (FDT_NOP);
|
||||
prop = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -419,7 +419,7 @@ int grub_fdt_set_prop (void *fdt, unsigned int nodeoffset, const char *name,
|
|||
struct_end(fdt) - (grub_addr_t) prop);
|
||||
grub_fdt_set_size_dt_struct (fdt, grub_fdt_get_size_dt_struct (fdt)
|
||||
+ prop_entry_size(len));
|
||||
*prop = grub_cpu_to_be32 (FDT_PROP);
|
||||
*prop = grub_cpu_to_be32_compile_time (FDT_PROP);
|
||||
*(prop + 2) = grub_cpu_to_be32 (nameoff);
|
||||
}
|
||||
*(prop + 1) = grub_cpu_to_be32 (len);
|
||||
|
@ -447,7 +447,7 @@ grub_fdt_create_empty_tree (void *fdt, unsigned int size)
|
|||
et->empty_node.node_end = grub_cpu_to_be32_compile_time (FDT_END_NODE);
|
||||
et->empty_node.node_start = grub_cpu_to_be32_compile_time (FDT_BEGIN_NODE);
|
||||
((struct grub_fdt_empty_tree *) fdt)->header.off_mem_rsvmap =
|
||||
grub_cpu_to_be32 (ALIGN_UP (sizeof (grub_fdt_header_t), 8));
|
||||
grub_cpu_to_be32_compile_time (ALIGN_UP (sizeof (grub_fdt_header_t), 8));
|
||||
|
||||
grub_fdt_set_off_dt_strings (fdt, sizeof (*et));
|
||||
grub_fdt_set_off_dt_struct (fdt,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue