From: Andrew Morton Date: Wed, 3 Jul 2013 22:02:11 +0000 (-0700) Subject: include/linux/mm.h: add PAGE_ALIGNED() helper X-Git-Tag: firefly_0821_release~3680^2~36^2~16^2^2~6 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7ebda0194ff1872ef36d93cf309cc4043ffba4ee;p=firefly-linux-kernel-4.4.55.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 Signed-off-by: Linus Torvalds (cherry picked from commit 0fa73b86ef0797ca4fde5334117ca0b330f08030) Signed-off-by: Christoffer Dall --- diff --git a/include/linux/mm.h b/include/linux/mm.h index e0c8528a41a4..f42c5baa47cc 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