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/northbridge/intel/nehalem/raminit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/northbridge/intel/nehalem') diff --git a/src/northbridge/intel/nehalem/raminit.c b/src/northbridge/intel/nehalem/raminit.c index 761dc527bf..6673b5a846 100644 --- a/src/northbridge/intel/nehalem/raminit.c +++ b/src/northbridge/intel/nehalem/raminit.c @@ -647,7 +647,7 @@ static void calculate_timings(struct raminfo *info) break; } } - min_cas_latency = (cas_latency_time + cycletime - 1) / cycletime; + min_cas_latency = CEIL_DIV(cas_latency_time, cycletime); cas_latency = 0; while (supported_cas_latencies) { cas_latency = find_highest_bit_set(supported_cas_latencies) + 3; @@ -3337,7 +3337,7 @@ static unsigned gcd(unsigned a, unsigned b) static inline int div_roundup(int a, int b) { - return (a + b - 1) / b; + return CEIL_DIV(a, b); } static unsigned lcm(unsigned a, unsigned b) -- cgit v1.2.3