From aa7a10e6dc9366e3962cf8a9912b25f25d63177e Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 21 Dec 2017 13:30:35 +0900 Subject: linux/kernel.h: move ALIGN_DOWN() to include/linux/kernel.h Linux commit ed067d4a859f ("linux/kernel.h: Add ALIGN_DOWN macro") moved ALIGN_DOWN to include/linux/kernel.h. Let's do likewise. Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- 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 dd7445e9b6..54c76d4641 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 b4d2f09081..ab713f20e9 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) -- cgit v1.2.3