]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
commands/acpi: Use ALIGN_UP rather than manual expression.
authorVladimir Serbinenko <phcoder@gmail.com>
Sat, 24 Jan 2015 19:41:43 +0000 (20:41 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Sat, 24 Jan 2015 19:41:43 +0000 (20:41 +0100)
Improves readability and hopefully automatic scanning.

Found by: Coverity Scan.

grub-core/commands/acpi.c

index 97c2cf282f94736aa3c3da4fd7c23b51db9bb678..f66fa2db32d5e09fe3bb55ee9abfa1553398d88f 100644 (file)
@@ -227,7 +227,7 @@ grub_acpi_create_ebda (void)
            grub_dprintf ("acpi", "Copying rsdpv2 to %p\n", target);
            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;
          }
@@ -246,7 +246,7 @@ grub_acpi_create_ebda (void)
            grub_dprintf ("acpi", "Copying rsdpv1 to %p\n", target);
            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;
          }