mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] linux/kernel.h: move ALIGN_DOWN() to include/linux/kernel.h
@ 2017-12-21  4:30 Masahiro Yamada
  2017-12-21  4:37 ` Masahiro Yamada
  0 siblings, 1 reply; 3+ messages in thread
From: Masahiro Yamada @ 2017-12-21  4:30 UTC (permalink / raw)
  To: barebox

Linux commit ed067d4a859f ("linux/kernel.h: Add ALIGN_DOWN macro")
moved ALIGN_MACRO to include/linux/kernel.h.

Let's do likewise.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 include/common.h       | 2 --
 include/linux/kernel.h | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/common.h b/include/common.h
index dd7445e..54c76d4 100644
--- a/include/common.h
+++ b/include/common.h
@@ -93,8 +93,6 @@ extern int (*barebox_main)(void);
 void __noreturn start_barebox(void);
 void shutdown_barebox(void);
 
-#define ALIGN_DOWN(x, a)	((x) & ~((typeof(x))(a) - 1))
-
 #define ARRAY_AND_SIZE(x)	(x), ARRAY_SIZE(x)
 
 /*
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index b4d2f09..ab713f2 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -33,6 +33,7 @@
 #define S64_MIN		((s64)(-S64_MAX - 1))
 
 #define ALIGN(x, a)		__ALIGN_MASK(x, (typeof(x))(a) - 1)
+#define ALIGN_DOWN(x, a)	ALIGN((x) - ((a) - 1), (a))
 #define __ALIGN_MASK(x, mask)	(((x) + (mask)) & ~(mask))
 #define PTR_ALIGN(p, a)		((typeof(p))ALIGN((unsigned long)(p), (a)))
 #define IS_ALIGNED(x, a)		(((x) & ((typeof(x))(a) - 1)) == 0)
-- 
2.7.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] linux/kernel.h: move ALIGN_DOWN() to include/linux/kernel.h
  2017-12-21  4:30 [PATCH] linux/kernel.h: move ALIGN_DOWN() to include/linux/kernel.h Masahiro Yamada
@ 2017-12-21  4:37 ` Masahiro Yamada
  2018-01-05 14:50   ` Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: Masahiro Yamada @ 2017-12-21  4:37 UTC (permalink / raw)
  To: barebox

2017-12-21 13:30 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
> Linux commit ed067d4a859f ("linux/kernel.h: Add ALIGN_DOWN macro")
> moved ALIGN_MACRO to include/linux/kernel.h.


This is a typo.

ALIGN_MACRO -> ALIGN_DOWN




> Let's do likewise.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
>  include/common.h       | 2 --
>  include/linux/kernel.h | 1 +
>  2 files changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/include/common.h b/include/common.h
> index dd7445e..54c76d4 100644
> --- a/include/common.h
> +++ b/include/common.h
> @@ -93,8 +93,6 @@ extern int (*barebox_main)(void);
>  void __noreturn start_barebox(void);
>  void shutdown_barebox(void);
>
> -#define ALIGN_DOWN(x, a)       ((x) & ~((typeof(x))(a) - 1))
> -
>  #define ARRAY_AND_SIZE(x)      (x), ARRAY_SIZE(x)
>
>  /*
> diff --git a/include/linux/kernel.h b/include/linux/kernel.h
> index b4d2f09..ab713f2 100644
> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -33,6 +33,7 @@
>  #define S64_MIN                ((s64)(-S64_MAX - 1))
>
>  #define ALIGN(x, a)            __ALIGN_MASK(x, (typeof(x))(a) - 1)
> +#define ALIGN_DOWN(x, a)       ALIGN((x) - ((a) - 1), (a))
>  #define __ALIGN_MASK(x, mask)  (((x) + (mask)) & ~(mask))
>  #define PTR_ALIGN(p, a)                ((typeof(p))ALIGN((unsigned long)(p), (a)))
>  #define IS_ALIGNED(x, a)               (((x) & ((typeof(x))(a) - 1)) == 0)
> --
> 2.7.4
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox



-- 
Best Regards
Masahiro Yamada

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] linux/kernel.h: move ALIGN_DOWN() to include/linux/kernel.h
  2017-12-21  4:37 ` Masahiro Yamada
@ 2018-01-05 14:50   ` Sascha Hauer
  0 siblings, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2018-01-05 14:50 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: barebox

On Thu, Dec 21, 2017 at 01:37:46PM +0900, Masahiro Yamada wrote:
> 2017-12-21 13:30 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
> > Linux commit ed067d4a859f ("linux/kernel.h: Add ALIGN_DOWN macro")
> > moved ALIGN_MACRO to include/linux/kernel.h.
> 
> 
> This is a typo.
> 
> ALIGN_MACRO -> ALIGN_DOWN

Applied with typo fixed, thanks.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-05 14:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-21  4:30 [PATCH] linux/kernel.h: move ALIGN_DOWN() to include/linux/kernel.h Masahiro Yamada
2017-12-21  4:37 ` Masahiro Yamada
2018-01-05 14:50   ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox