From 6df3b64c77a868ab8526b980561ed2be3fe392b6 Mon Sep 17 00:00:00 2001 From: Elyes HAOUAS Date: Mon, 26 Nov 2018 22:53:49 +0100 Subject: src: Remove duplicated round up function This removes CEIL_DIV and div_round_up() altogether and replace it by DIV_ROUND_UP defined in commonlib/helpers.h. Change-Id: I9aabc3fbe7834834c92d6ba59ff0005986622a34 Signed-off-by: Elyes HAOUAS Reviewed-on: https://review.coreboot.org/c/29847 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi Reviewed-by: Marshall Dawson --- src/arch/arm/armv7/mmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/arch') diff --git a/src/arch/arm/armv7/mmu.c b/src/arch/arm/armv7/mmu.c index b63497ce8f..8ebb84855d 100644 --- a/src/arch/arm/armv7/mmu.c +++ b/src/arch/arm/armv7/mmu.c @@ -236,7 +236,7 @@ void mmu_disable_range_kb(u32 start_kb, u32 size_kb) printk(BIOS_DEBUG, "Setting address range [%#.8x:%#.8x) as unmapped\n", start_kb * KiB, (start_kb + size_kb) * KiB); mmu_fill_table(table, (start_kb & mask) / (PAGE_SIZE/KiB), - div_round_up((start_kb + size_kb) & mask, PAGE_SIZE/KiB), + DIV_ROUND_UP((start_kb + size_kb) & mask, PAGE_SIZE/KiB), (start_kb & ~mask) * KiB, PAGE_SHIFT, 0); } @@ -246,7 +246,7 @@ void mmu_disable_range(u32 start_mb, u32 size_mb) start_mb * MiB, (start_mb + size_mb) * MiB); assert(start_mb + size_mb <= 4 * (GiB/MiB)); mmu_fill_table(ttb_buff, start_mb / (BLOCK_SIZE/MiB), - div_round_up(start_mb + size_mb, BLOCK_SIZE/MiB), + DIV_ROUND_UP(start_mb + size_mb, BLOCK_SIZE/MiB), 0, BLOCK_SHIFT, 0); } @@ -256,7 +256,7 @@ void mmu_config_range(u32 start_mb, u32 size_mb, enum dcache_policy policy) start_mb * MiB, (start_mb + size_mb) * MiB, attrs[policy].name); assert(start_mb + size_mb <= 4 * (GiB/MiB)); mmu_fill_table(ttb_buff, start_mb / (BLOCK_SIZE/MiB), - div_round_up(start_mb + size_mb, BLOCK_SIZE/MiB), + DIV_ROUND_UP(start_mb + size_mb, BLOCK_SIZE/MiB), 0, BLOCK_SHIFT, ATTR_BLOCK | attrs[policy].value); } -- cgit v1.2.3