From 11eb2ca409cc0d102e8c2292f5abcee6ffffa2ae Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Wed, 16 Nov 2011 14:12:57 +0400 Subject: [PATCH] Add ALIGN helper Signed-off-by: Cyrill Gorcunov --- include/compiler.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/compiler.h b/include/compiler.h index 8a2143999..290d5e9c8 100644 --- a/include/compiler.h +++ b/include/compiler.h @@ -41,6 +41,7 @@ #define round_up(x, y) ((((x) - 1) | __round_mask(x, y)) + 1) #define round_down(x, y) ((x) & ~__round_mask(x, y)) #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) +#define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1)) #define min(x, y) ({ \ typeof(x) _min1 = (x); \