Get the biggest 2**y that x % (2**y) == 0 for the align value. Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx> --- include/linux/kernel.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 5113462..2c439dc 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -44,6 +44,8 @@ #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) +#define ALIGN_OF_LAST_BIT(x) ((((x)^((x) - 1))>>1) + 1) + #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) /* -- 1.7.4.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>