From: Andrew Morton <akpm@linux-foundation.org>
Date: Wed Jul 3 15:02:11 2013 -0700
Subject: include/linux/mm.h: add PAGE_ALIGNED() helper
References: FATE#317317
Git-commit: 0fa73b86ef0797ca4fde5334117ca0b330f08030
Patch-mainline:v3.11-rc1

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>
Acked-by: Petr Tesarik <ptesarik@suse.cz>

---
 include/linux/mm.h |    3 +++
 1 file changed, 3 insertions(+)

--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -46,6 +46,9 @@ extern int sysctl_legacy_va_layout;
 /* 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
