From 022f12163595b9a55380c6d77c3119b93d6a9a4b Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Mon, 21 Apr 2008 09:28:36 -0500 Subject: 85xx: Round up frequency calculations to get reasonable output eg. because of rounding error we can get 799Mhz instead of 800Mhz. Introduced DIV_ROUND_UP and roundup taken from linux kernel. Signed-off-by: Dejan Minic Signed-off-by: Srikanth Srinivasan Signed-off-by: Kumar Gala Acked-by: Andy Fleming --- include/common.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/common.h') diff --git a/include/common.h b/include/common.h index aea181e2ab..11b7d31c45 100644 --- a/include/common.h +++ b/include/common.h @@ -670,6 +670,9 @@ void inline show_boot_progress (int val); #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) +#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) + /* Multicore arch functions */ #ifdef CONFIG_MP int cpu_status(int nr); -- cgit