diff mbox series

linux/kernel.h: Add ALIGN_DOWN macro

Message ID 1513831907-8641-1-git-send-email-yamada.masahiro@socionext.com
State Accepted
Commit 75db00eea03d5b892c4e69ab17891fca968187d3
Headers show
Series linux/kernel.h: Add ALIGN_DOWN macro | expand

Commit Message

Masahiro Yamada Dec. 21, 2017, 4:51 a.m. UTC
Follow Linux commit ed067d4a859f ("linux/kernel.h: Add ALIGN_DOWN
macro").

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

 include/linux/kernel.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Tom Rini Jan. 10, 2018, 4:44 p.m. UTC | #1
On Thu, Dec 21, 2017 at 01:51:46PM +0900, Masahiro Yamada wrote:

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

> macro").

> 

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


Applied to u-boot/master, thanks!

-- 
Tom
diff mbox series

Patch

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 87d2d95..04a09eb 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)