summaryrefslogtreecommitdiff
path: root/include/linux/kernel.h
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.m@jp.panasonic.com>2014-11-07 03:03:30 +0900
committerTom Rini <trini@ti.com>2014-11-20 11:28:25 -0500
commit111396ccb9a8d3e1f0e9d9921d3dbd6c7a70423f (patch)
treea1acad32c2f2c1c0fcef6f0504ef7d4c339a5c66 /include/linux/kernel.h
parent48c7ea39663a7c151a2a0b1af5d45ae3cf676299 (diff)
downloadu-boot-111396ccb9a8d3e1f0e9d9921d3dbd6c7a70423f.tar.gz
u-boot-111396ccb9a8d3e1f0e9d9921d3dbd6c7a70423f.tar.bz2
u-boot-111396ccb9a8d3e1f0e9d9921d3dbd6c7a70423f.zip
linux/kernel.h: add typechecking to roundup macro
This commit replaces roundup macro with the one from Linux Kernel. DEFINE_ALIGN_BUFFER must be fixed because typechecking can not be used in this context. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r--include/linux/kernel.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index f84a764bc9..0e838de094 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -61,8 +61,13 @@
# define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP(ll,d)
#endif
-#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
-
+/* The `const' in roundup() prevents gcc-3.3 from calling __divdi3 */
+#define roundup(x, y) ( \
+{ \
+ const typeof(y) __y = y; \
+ (((x) + (__y - 1)) / __y) * __y; \
+} \
+)
#define rounddown(x, y) ( \
{ \
typeof(x) __x = (x); \