From 7116ac803736345cc7c7b73ac435efa50c4cd2b0 Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Tue, 8 Jul 2014 01:53:24 +1000 Subject: src: Make use of 'CEIL_DIV(a, b)' macro across tree The objective here is to tighten coreboot up a bit by not repeating common helpers. This makes the code base more consistent and unified/tight. Change-Id: Ia163eae68b4a84a00ed118125e70308fab1cea0c Signed-off-by: Edward O'Callaghan Reviewed-on: http://review.coreboot.org/6215 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi Reviewed-by: Paul Menzel --- src/cpu/samsung/exynos5420/cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cpu/samsung/exynos5420/cpu.c') diff --git a/src/cpu/samsung/exynos5420/cpu.c b/src/cpu/samsung/exynos5420/cpu.c index 5ff345eaa8..176a3f2595 100644 --- a/src/cpu/samsung/exynos5420/cpu.c +++ b/src/cpu/samsung/exynos5420/cpu.c @@ -140,7 +140,7 @@ static void exynos_displayport_init(device_t dev, u32 lcdbase, dcache_clean_invalidate_by_mva(lower, upper - lower); mmu_config_range(lower / MiB, (upper - lower) / MiB, DCACHE_OFF); - mmio_resource(dev, 1, lcdbase/KiB, (fb_size + KiB - 1)/KiB); + mmio_resource(dev, 1, lcdbase/KiB, CEIL_DIV(fb_size, KiB)); } static void tps65090_thru_ec_fet_disable(int index) @@ -160,7 +160,7 @@ static void cpu_enable(device_t dev) u32 lcdbase = get_fb_base_kb() * KiB; ram_resource(dev, 0, RAM_BASE_KB, RAM_SIZE_KB - FB_SIZE_KB); - mmio_resource(dev, 1, lcdbase / KiB, (fb_size + KiB - 1) / KiB); + mmio_resource(dev, 1, lcdbase / KiB, CEIL_DIV(fb_size, KiB)); /* * Disable LCD FETs before we do anything with the display. -- cgit v1.2.3