summaryrefslogtreecommitdiff
path: root/include/linux/kernel.h
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2017-12-21 13:30:35 +0900
committerSascha Hauer <s.hauer@pengutronix.de>2018-01-05 15:49:44 +0100
commitaa7a10e6dc9366e3962cf8a9912b25f25d63177e (patch)
tree9f3221dd39c2ed684009e9cfe0ce3e67b3008b55 /include/linux/kernel.h
parent48e7b8ae0de2e3a7ec08286e764c46768da9b2bf (diff)
downloadbarebox-aa7a10e6dc9366e3962cf8a9912b25f25d63177e.tar.gz
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 <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r--include/linux/kernel.h1
1 files changed, 1 insertions, 0 deletions
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)