]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
commands/acpi: Use ALIGN_UP rather than manual expression.
authorVladimir Serbinenko <phcoder@gmail.com>
Tue, 27 Jan 2015 09:20:54 +0000 (10:20 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Tue, 27 Jan 2015 15:32:21 +0000 (16:32 +0100)
Improves readability and hopefully automatic scanning.

Found by: Coverity Scan.

grub-core/commands/acpi.c

index f66fa2db32d5e09fe3bb55ee9abfa1553398d88f..5507ffa0885834e037c9ab98ce13e732fc7100ad 100644 (file)
@@ -265,7 +265,7 @@ grub_acpi_create_ebda (void)
            grub_memcpy (target, v2, v2->length);
            v2inebda = target;
            target += v2->length;
-           target = (grub_uint8_t *) ((((grub_addr_t) target - 1) | 0xf) + 1);
+           target = (grub_uint8_t *) ALIGN_UP((grub_addr_t) target, 16);
            v2 = 0;
            break;
          }
@@ -282,7 +282,7 @@ grub_acpi_create_ebda (void)
            grub_memcpy (target, v1, sizeof (struct grub_acpi_rsdp_v10));
            v1inebda = target;
            target += sizeof (struct grub_acpi_rsdp_v10);
-           target = (grub_uint8_t *) ((((grub_addr_t) target - 1) | 0xf) + 1);
+           target = (grub_uint8_t *) ALIGN_UP((grub_addr_t) target, 16);
            v1 = 0;
            break;
          }