* grub-core/commands/lsacpi.c (disp_acpi_xsdt_table): #if'-out the

checks which are always false on some platforms.
	(grub_cmd_lsacpi): Likewise.
	* grub-core/kern/misc.c (grub_strtoul): Likewise.
	* grub-core/loader/multiboot.c (grub_multiboot_set_video_mode):
	Likewise.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-02-09 23:48:34 +01:00
parent def9fc1bb2
commit a4ea2dff4b
4 changed files with 23 additions and 4 deletions

View file

@ -1,3 +1,12 @@
2012-02-09 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/commands/lsacpi.c (disp_acpi_xsdt_table): #if'-out the
checks which are always false on some platforms.
(grub_cmd_lsacpi): Likewise.
* grub-core/kern/misc.c (grub_strtoul): Likewise.
* grub-core/loader/multiboot.c (grub_multiboot_set_video_mode):
Likewise.
2012-02-09 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/disk/diskfilter.c (read_segment): Renome unreachable code.

View file

@ -132,11 +132,13 @@ disp_acpi_xsdt_table (struct grub_acpi_table_header *t)
desc = (grub_uint64_t *) (t + 1);
for (; len > 0; desc++, len -= sizeof (*desc))
{
if (sizeof (grub_addr_t) == 4 && *desc >= (1ULL << 32))
#if GRUB_CPU_SIZEOF_VOID_P == 4
if (*desc >= (1ULL << 32))
{
grub_printf ("Unreachable table\n");
continue;
}
#endif
t = (struct grub_acpi_table_header *) (grub_addr_t) *desc;
if (t == NULL)
@ -222,9 +224,11 @@ grub_cmd_lsacpi (struct grub_extcmd_context *ctxt,
grub_printf ("No RSDPv2\n");
else
{
if (sizeof (grub_addr_t) == 4 && rsdp2->xsdt_addr >= (1ULL << 32))
#if GRUB_CPU_SIZEOF_VOID_P == 4
if (rsdp2->xsdt_addr >= (1ULL << 32))
grub_printf ("Unreachable RSDPv2\n");
else
#endif
{
grub_printf ("RSDPv2 signature:");
disp_acpi_rsdpv2 (rsdp2);

View file

@ -370,11 +370,13 @@ grub_strtoul (const char *str, char **end, int base)
unsigned long long num;
num = grub_strtoull (str, end, base);
#if GRUB_CPU_SIZEOF_LONG != 8
if (num > ~0UL)
{
grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
return ~0UL;
}
#endif
return (unsigned long) num;
}

View file

@ -90,7 +90,9 @@ grub_multiboot_set_video_mode (void)
grub_err_t err;
const char *modevar;
if (accepts_video || !GRUB_MACHINE_HAS_VGA_TEXT)
#if GRUB_MACHINE_HAS_VGA_TEXT
if (accepts_video)
#endif
{
modevar = grub_env_get ("gfxpayload");
if (! modevar || *modevar == 0)
@ -105,8 +107,10 @@ grub_multiboot_set_video_mode (void)
grub_free (tmp);
}
}
#if GRUB_MACHINE_HAS_VGA_TEXT
else
err = grub_video_set_mode ("text", 0, 0);
#endif
return err;
}