summaryrefslogtreecommitdiff
path: root/include/common.h
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2008-10-19 02:35:48 +0200
committerWolfgang Denk <wd@denx.de>2008-10-21 11:25:35 +0200
commitd50c7d4be150b2252c0d2e16cfcf69643bdd6dc9 (patch)
treef5ee3bd016b0e306564262925b471b8ba5825544 /include/common.h
parent681c02d05b29c6d46093525052c74b9c4ddc8b08 (diff)
strmhz(): Round numbers when printing clock frequencies
Round clock frequencies for printing. Many boards printed off clock frequencies like 399 MHz instead of the exact 400 MHz because numberes were not rounded. This is fixed now. Signed-off-by: Wolfgang Denk <wd@denx.de>
Diffstat (limited to 'include/common.h')
-rw-r--r--include/common.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/common.h b/include/common.h
index e65904413..b8a654a8a 100644
--- a/include/common.h
+++ b/include/common.h
@@ -692,8 +692,9 @@ void __attribute__((weak)) 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))
+#define DIV_ROUND(n,d) (((n) + ((d)/2)) / (d))
+#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
+#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
#define ALIGN(x,a) __ALIGN_MASK((x),(typeof(x))(a)-1)
#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))