From e378cdbb618e583ff09cc64ceefdd9365ff3d815 Mon Sep 17 00:00:00 2001 From: Elyes Haouas Date: Sun, 11 Sep 2022 12:02:46 +0200 Subject: [PATCH] mb/amd/*/irq_tables.cmb/*/*/irq_tables.c: Use ALIGN_UP macro Change-Id: I2bd5e09f51918fe4c7e954edf54ab4d9bc629fd1 Signed-off-by: Elyes Haouas Reviewed-on: https://review.coreboot.org/c/coreboot/+/61919 Tested-by: build bot (Jenkins) Reviewed-by: Felix Held --- src/mainboard/amd/gardenia/irq_tables.c | 4 ++-- src/mainboard/amd/inagua/irq_tables.c | 4 ++-- src/mainboard/amd/olivehill/irq_tables.c | 4 ++-- src/mainboard/amd/parmer/irq_tables.c | 4 ++-- src/mainboard/amd/persimmon/irq_tables.c | 3 +-- src/mainboard/amd/south_station/irq_tables.c | 4 ++-- src/mainboard/amd/thatcher/irq_tables.c | 4 ++-- src/mainboard/amd/union_station/irq_tables.c | 4 ++-- 8 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/mainboard/amd/gardenia/irq_tables.c b/src/mainboard/amd/gardenia/irq_tables.c index 3df5011efd..2eefedecc9 100644 --- a/src/mainboard/amd/gardenia/irq_tables.c +++ b/src/mainboard/amd/gardenia/irq_tables.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include +#include #include #include #include @@ -36,8 +37,7 @@ unsigned long write_pirq_routing_table(unsigned long addr) int i; /* Align the table to be 16 byte aligned. */ - addr += 15; - addr &= ~15; + addr = ALIGN_UP(addr, 16); /* This table must be between 0xf0000 & 0x100000 */ printk(BIOS_INFO, "Writing IRQ routing tables to 0x%lx...", addr); diff --git a/src/mainboard/amd/inagua/irq_tables.c b/src/mainboard/amd/inagua/irq_tables.c index 60ac2c0d3d..4f239948ca 100644 --- a/src/mainboard/amd/inagua/irq_tables.c +++ b/src/mainboard/amd/inagua/irq_tables.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include +#include #include #include #include @@ -36,8 +37,7 @@ unsigned long write_pirq_routing_table(unsigned long addr) int i; /* Align the table to be 16 byte aligned. */ - addr += 15; - addr &= ~15; + addr = ALIGN_UP(addr, 16); /* This table must be between 0xf0000 & 0x100000 */ printk(BIOS_INFO, "Writing IRQ routing tables to 0x%lx...", addr); diff --git a/src/mainboard/amd/olivehill/irq_tables.c b/src/mainboard/amd/olivehill/irq_tables.c index 60ac2c0d3d..4f239948ca 100644 --- a/src/mainboard/amd/olivehill/irq_tables.c +++ b/src/mainboard/amd/olivehill/irq_tables.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include +#include #include #include #include @@ -36,8 +37,7 @@ unsigned long write_pirq_routing_table(unsigned long addr) int i; /* Align the table to be 16 byte aligned. */ - addr += 15; - addr &= ~15; + addr = ALIGN_UP(addr, 16); /* This table must be between 0xf0000 & 0x100000 */ printk(BIOS_INFO, "Writing IRQ routing tables to 0x%lx...", addr); diff --git a/src/mainboard/amd/parmer/irq_tables.c b/src/mainboard/amd/parmer/irq_tables.c index 60ac2c0d3d..4f239948ca 100644 --- a/src/mainboard/amd/parmer/irq_tables.c +++ b/src/mainboard/amd/parmer/irq_tables.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include +#include #include #include #include @@ -36,8 +37,7 @@ unsigned long write_pirq_routing_table(unsigned long addr) int i; /* Align the table to be 16 byte aligned. */ - addr += 15; - addr &= ~15; + addr = ALIGN_UP(addr, 16); /* This table must be between 0xf0000 & 0x100000 */ printk(BIOS_INFO, "Writing IRQ routing tables to 0x%lx...", addr); diff --git a/src/mainboard/amd/persimmon/irq_tables.c b/src/mainboard/amd/persimmon/irq_tables.c index 60ac2c0d3d..85ab57abc6 100644 --- a/src/mainboard/amd/persimmon/irq_tables.c +++ b/src/mainboard/amd/persimmon/irq_tables.c @@ -36,8 +36,7 @@ unsigned long write_pirq_routing_table(unsigned long addr) int i; /* Align the table to be 16 byte aligned. */ - addr += 15; - addr &= ~15; + addr = ALIGN_UP(addr, 16); /* This table must be between 0xf0000 & 0x100000 */ printk(BIOS_INFO, "Writing IRQ routing tables to 0x%lx...", addr); diff --git a/src/mainboard/amd/south_station/irq_tables.c b/src/mainboard/amd/south_station/irq_tables.c index 60ac2c0d3d..4f239948ca 100644 --- a/src/mainboard/amd/south_station/irq_tables.c +++ b/src/mainboard/amd/south_station/irq_tables.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include +#include #include #include #include @@ -36,8 +37,7 @@ unsigned long write_pirq_routing_table(unsigned long addr) int i; /* Align the table to be 16 byte aligned. */ - addr += 15; - addr &= ~15; + addr = ALIGN_UP(addr, 16); /* This table must be between 0xf0000 & 0x100000 */ printk(BIOS_INFO, "Writing IRQ routing tables to 0x%lx...", addr); diff --git a/src/mainboard/amd/thatcher/irq_tables.c b/src/mainboard/amd/thatcher/irq_tables.c index 60ac2c0d3d..4f239948ca 100644 --- a/src/mainboard/amd/thatcher/irq_tables.c +++ b/src/mainboard/amd/thatcher/irq_tables.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include +#include #include #include #include @@ -36,8 +37,7 @@ unsigned long write_pirq_routing_table(unsigned long addr) int i; /* Align the table to be 16 byte aligned. */ - addr += 15; - addr &= ~15; + addr = ALIGN_UP(addr, 16); /* This table must be between 0xf0000 & 0x100000 */ printk(BIOS_INFO, "Writing IRQ routing tables to 0x%lx...", addr); diff --git a/src/mainboard/amd/union_station/irq_tables.c b/src/mainboard/amd/union_station/irq_tables.c index 60ac2c0d3d..4f239948ca 100644 --- a/src/mainboard/amd/union_station/irq_tables.c +++ b/src/mainboard/amd/union_station/irq_tables.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include +#include #include #include #include @@ -36,8 +37,7 @@ unsigned long write_pirq_routing_table(unsigned long addr) int i; /* Align the table to be 16 byte aligned. */ - addr += 15; - addr &= ~15; + addr = ALIGN_UP(addr, 16); /* This table must be between 0xf0000 & 0x100000 */ printk(BIOS_INFO, "Writing IRQ routing tables to 0x%lx...", addr);