From 26b00e6d3954dcfa00ee4d7c874161b2fbdd2ce2 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Fri, 20 Apr 2012 19:19:47 +0200 Subject: Refactor some alignment handling Made using coccinelle: @@ expression E; @@ -(E + 7) & -8 +ALIGN(E, 8) @@ expression E; @@ -(E + 15) & -16 +ALIGN(E, 16) Change-Id: I071d2c98cd95580d7de21d256c31b6368a3dc70b Signed-off-by: Patrick Georgi Reviewed-on: http://review.coreboot.org/910 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich Reviewed-by: Stefan Reinauer --- src/mainboard/amd/serengeti_cheetah/acpi_tables.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mainboard/amd/serengeti_cheetah/acpi_tables.c') diff --git a/src/mainboard/amd/serengeti_cheetah/acpi_tables.c b/src/mainboard/amd/serengeti_cheetah/acpi_tables.c index 47bd34b90e..fb31750077 100644 --- a/src/mainboard/amd/serengeti_cheetah/acpi_tables.c +++ b/src/mainboard/amd/serengeti_cheetah/acpi_tables.c @@ -174,7 +174,7 @@ unsigned long write_acpi_tables(unsigned long start) get_bus_conf(); //it will get sblk, pci1234, hcdn, and sbdn /* Align ACPI tables to 16 bytes */ - start = ( start + 0x0f) & -0x10; + start = ALIGN(start, 16); current = start; printk(BIOS_INFO, "ACPI: Writing ACPI tables at %lx...\n", start); @@ -264,7 +264,7 @@ unsigned long write_acpi_tables(unsigned long start) else { c = (u8) ('A' + i - 1 - 6); } - current = (current + 0x07) & -0x08; + current = ALIGN(current, 8); printk(BIOS_DEBUG, "ACPI: * SSDT for PCI%c Aka hcid = %d\n", c, sysconf.hcid[i]); //pci0 and pci1 are in dsdt ssdtx = (acpi_header_t *)current; switch(sysconf.hcid[i]) { -- cgit v1.2.3