From: Masahiro Yamada <yamada.masahiro@socionext.com>
Date: Thu, 21 Dec 2017 04:51:46 +0000 (+0900)
Subject: linux/kernel.h: Add ALIGN_DOWN macro
X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=75db00eea03d5b892c4e69ab17891fca968187d3;p=project%2Fbcm63xx%2Fu-boot.git

linux/kernel.h: Add ALIGN_DOWN macro

Follow Linux commit ed067d4a859f ("linux/kernel.h: Add ALIGN_DOWN
macro").

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

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 87d2d9554d..04a09eb4f6 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -38,6 +38,7 @@
 #define REPEAT_BYTE(x)	((~0ul / 0xff) * (x))
 
 #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)