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
|
@ -365,7 +365,7 @@ grub_reiserfs_set_key_offset (struct grub_reiserfs_key *key,
|
|||
key->u.v1.offset = grub_cpu_to_le32 (value);
|
||||
else
|
||||
key->u.v2.offset_type \
|
||||
= ((key->u.v2.offset_type & grub_cpu_to_le64 (15ULL << 60))
|
||||
= ((key->u.v2.offset_type & grub_cpu_to_le64_compile_time (15ULL << 60))
|
||||
| grub_cpu_to_le64 (value & (~0ULL >> 4)));
|
||||
}
|
||||
|
||||
|
@ -412,7 +412,7 @@ grub_reiserfs_set_key_type (struct grub_reiserfs_key *key,
|
|||
key->u.v1.type = grub_cpu_to_le32 (type);
|
||||
else
|
||||
key->u.v2.offset_type
|
||||
= ((key->u.v2.offset_type & grub_cpu_to_le64 (~0ULL >> 4))
|
||||
= ((key->u.v2.offset_type & grub_cpu_to_le64_compile_time (~0ULL >> 4))
|
||||
| grub_cpu_to_le64 ((grub_uint64_t) type << 60));
|
||||
|
||||
assert (grub_reiserfs_get_key_type (key) == grub_type);
|
||||
|
@ -997,8 +997,8 @@ grub_reiserfs_open (struct grub_file *file, const char *name)
|
|||
data = grub_reiserfs_mount (file->device->disk);
|
||||
if (! data)
|
||||
goto fail;
|
||||
key.directory_id = grub_cpu_to_le32 (1);
|
||||
key.object_id = grub_cpu_to_le32 (2);
|
||||
key.directory_id = grub_cpu_to_le32_compile_time (1);
|
||||
key.object_id = grub_cpu_to_le32_compile_time (2);
|
||||
key.u.v2.offset_type = 0;
|
||||
grub_reiserfs_set_key_type (&key, GRUB_REISERFS_DIRECTORY, 2);
|
||||
grub_reiserfs_set_key_offset (&key, 1);
|
||||
|
@ -1289,8 +1289,8 @@ grub_reiserfs_dir (grub_device_t device, const char *path,
|
|||
data = grub_reiserfs_mount (device->disk);
|
||||
if (! data)
|
||||
goto fail;
|
||||
root_key.directory_id = grub_cpu_to_le32 (1);
|
||||
root_key.object_id = grub_cpu_to_le32 (2);
|
||||
root_key.directory_id = grub_cpu_to_le32_compile_time (1);
|
||||
root_key.object_id = grub_cpu_to_le32_compile_time (2);
|
||||
root_key.u.v2.offset_type = 0;
|
||||
grub_reiserfs_set_key_type (&root_key, GRUB_REISERFS_DIRECTORY, 2);
|
||||
grub_reiserfs_set_key_offset (&root_key, 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue