From 4192f2e3d1779b71f53580a59f280af1bfda1f3b Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 27 Jan 2015 10:20:54 +0100 Subject: [PATCH] commands/acpi: Use ALIGN_UP rather than manual expression. Improves readability and hopefully automatic scanning. Found by: Coverity Scan. --- grub-core/commands/acpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/commands/acpi.c b/grub-core/commands/acpi.c index f66fa2db3..5507ffa08 100644 --- a/grub-core/commands/acpi.c +++ b/grub-core/commands/acpi.c @@ -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; }