* [U-Boot] [PATCH] linux/kernel.h: import DIV_ROUND_{DOWN, UP}_ULL from Linux
@ 2017-09-13 10:16 Masahiro Yamada
2017-10-06 1:27 ` Masahiro Yamada
2017-10-07 13:06 ` [U-Boot] " Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Masahiro Yamada @ 2017-09-13 10:16 UTC (permalink / raw)
To: u-boot
These macros are useful to avoid link error on 32-bit systems.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
include/linux/kernel.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 0b61671..87d2d95 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -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
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] linux/kernel.h: import DIV_ROUND_{DOWN, UP}_ULL from Linux
2017-09-13 10:16 [U-Boot] [PATCH] linux/kernel.h: import DIV_ROUND_{DOWN, UP}_ULL from Linux Masahiro Yamada
@ 2017-10-06 1:27 ` Masahiro Yamada
2017-10-07 13:06 ` [U-Boot] " Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2017-10-06 1:27 UTC (permalink / raw)
To: u-boot
Hi Tom,
2017-09-13 19:16 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
> These macros are useful to avoid link error on 32-bit systems.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
> include/linux/kernel.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/include/linux/kernel.h b/include/linux/kernel.h
> index 0b61671..87d2d95 100644
> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -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
> --
> 2.7.4
Could you pick this up, if you missed it.
I am just copying these two macros from Linux.
I do not think it is controversial.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] linux/kernel.h: import DIV_ROUND_{DOWN, UP}_ULL from Linux
2017-09-13 10:16 [U-Boot] [PATCH] linux/kernel.h: import DIV_ROUND_{DOWN, UP}_ULL from Linux Masahiro Yamada
2017-10-06 1:27 ` Masahiro Yamada
@ 2017-10-07 13:06 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2017-10-07 13:06 UTC (permalink / raw)
To: u-boot
On Wed, Sep 13, 2017 at 07:16:44PM +0900, Masahiro Yamada wrote:
> These macros are useful to avoid link error on 32-bit systems.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171007/9cd66b12/attachment.sig>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-10-07 13:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-13 10:16 [U-Boot] [PATCH] linux/kernel.h: import DIV_ROUND_{DOWN, UP}_ULL from Linux Masahiro Yamada
2017-10-06 1:27 ` Masahiro Yamada
2017-10-07 13:06 ` [U-Boot] " Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.