Skip to content
Snippets Groups Projects
Commit 84570a0c authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Tom Rini
Browse files

linux/kernel.h: import DIV_ROUND_{DOWN, UP}_ULL from Linux


These macros are useful to avoid link error on 32-bit systems.

Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 3ea05205
No related branches found
No related tags found
No related merge requests found
......@@ -57,6 +57,11 @@
#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
#define DIV_ROUND_DOWN_ULL(ll, d) \
({ unsigned long long _tmp = (ll); do_div(_tmp, d); _tmp; })
#define DIV_ROUND_UP_ULL(ll, d) DIV_ROUND_DOWN_ULL((ll) + (d) - 1, (d))
#if BITS_PER_LONG == 32
# define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP_ULL(ll, d)
#else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment