From: Andrew Morton Date: Fri, 7 Jun 2013 00:07:46 +0000 (+1000) Subject: include/linux/mm.h: add PAGE_ALIGNED() helper X-Git-Tag: next-20130607~2^2~423 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=dec27122dc5311761d3b7410b23e9e0b1f05c8be;p=karo-tx-linux.git include/linux/mm.h: add PAGE_ALIGNED() helper To test whether an address is aligned to PAGE_SIZE. Cc: HATAYAMA Daisuke Cc: "Eric W. Biederman" , Signed-off-by: Andrew Morton --- diff --git a/include/linux/mm.h b/include/linux/mm.h index 66d881f1d576..949bd7035895 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -52,6 +52,9 @@ extern unsigned long sysctl_admin_reserve_kbytes; /* to align the pointer to the (next) page boundary */ #define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE) +/* test whether an address (unsigned long or pointer) is aligned to PAGE_SIZE */ +#define PAGE_ALIGNED(addr) IS_ALIGNED((unsigned long)addr, PAGE_SIZE) + /* * Linux kernel virtual memory manager primitives. * The idea being to have a "virtual" mm in the same way