loader/arm64/xen_boot: Use bool instead of int
More readable, could consume less space. Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com> Reviewed-by: Sudhakar Kuppusamy <sudhakar@linux.ibm.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
parent
d1a470b694
commit
e82609a476
@ -67,7 +67,7 @@ struct xen_boot_binary
|
||||
{
|
||||
struct xen_boot_binary *next;
|
||||
struct xen_boot_binary **prev;
|
||||
int is_hypervisor;
|
||||
bool is_hypervisor;
|
||||
|
||||
grub_addr_t start;
|
||||
grub_size_t size;
|
||||
@ -79,7 +79,7 @@ struct xen_boot_binary
|
||||
|
||||
static grub_dl_t my_mod;
|
||||
|
||||
static int loaded;
|
||||
static bool loaded;
|
||||
|
||||
static struct xen_boot_binary *xen_hypervisor;
|
||||
static struct xen_boot_binary *module_head;
|
||||
@ -276,7 +276,7 @@ single_binary_unload (struct xen_boot_binary *binary)
|
||||
binary->cmdline, binary->cmdline_size);
|
||||
}
|
||||
|
||||
if (!binary->is_hypervisor)
|
||||
if (binary->is_hypervisor == false)
|
||||
grub_list_remove (GRUB_AS_LIST (binary));
|
||||
|
||||
grub_dprintf ("xen_loader",
|
||||
@ -306,7 +306,7 @@ all_binaries_unload (void)
|
||||
static grub_err_t
|
||||
xen_unload (void)
|
||||
{
|
||||
loaded = 0;
|
||||
loaded = false;
|
||||
all_binaries_unload ();
|
||||
grub_fdt_unload ();
|
||||
grub_dl_unref (my_mod);
|
||||
@ -398,7 +398,7 @@ grub_cmd_xen_module (grub_command_t cmd __attribute__((unused)),
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!loaded)
|
||||
if (loaded == false)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
N_("you need to load the Xen Hypervisor first"));
|
||||
@ -410,7 +410,7 @@ grub_cmd_xen_module (grub_command_t cmd __attribute__((unused)),
|
||||
if (!module)
|
||||
return grub_errno;
|
||||
|
||||
module->is_hypervisor = 0;
|
||||
module->is_hypervisor = false;
|
||||
module->align = 4096;
|
||||
|
||||
grub_dprintf ("xen_loader", "Init module and node info\n");
|
||||
@ -466,7 +466,7 @@ grub_cmd_xen_hypervisor (grub_command_t cmd __attribute__ ((unused)),
|
||||
if (!xen_hypervisor)
|
||||
return grub_errno;
|
||||
|
||||
xen_hypervisor->is_hypervisor = 1;
|
||||
xen_hypervisor->is_hypervisor = true;
|
||||
xen_hypervisor->align
|
||||
= (grub_size_t) lh.pe_image_header.optional_header.section_alignment;
|
||||
|
||||
@ -474,7 +474,7 @@ grub_cmd_xen_hypervisor (grub_command_t cmd __attribute__ ((unused)),
|
||||
if (grub_errno == GRUB_ERR_NONE)
|
||||
{
|
||||
grub_loader_set (xen_boot, xen_unload, 0);
|
||||
loaded = 1;
|
||||
loaded = true;
|
||||
}
|
||||
|
||||
fail:
|
||||
@ -482,7 +482,7 @@ fail:
|
||||
grub_file_close (file);
|
||||
if (grub_errno != GRUB_ERR_NONE)
|
||||
{
|
||||
loaded = 0;
|
||||
loaded = false;
|
||||
all_binaries_unload ();
|
||||
grub_dl_unref (my_mod);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user