diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2013-07-04 02:02:11 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-04 03:07:30 +0400 |
commit | 0fa73b86ef0797ca4fde5334117ca0b330f08030 (patch) | |
tree | e3c9a84f928a23b6613f177837fcfd6beb8e41f2 /include | |
parent | d702909f0aa14fe678d74d7f974aa66bfb211d0b (diff) | |
download | linux-0fa73b86ef0797ca4fde5334117ca0b330f08030.tar.xz |
include/linux/mm.h: add PAGE_ALIGNED() helper
To test whether an address is aligned to PAGE_SIZE.
Cc: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mm.h | 3 |
1 files changed, 3 insertions, 0 deletions
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 |