Resolves: bz1097904
https://bugzilla.redhat.com/show_bug.cgi?id=1097904

This is back ported from upstream directly.

commit 0fa73b86ef0797ca4fde5334117ca0b330f08030
Author: Andrew Morton <[email protected]>
Date:   Wed Jul 3 15:02:11 2013 -0700

    include/linux/mm.h: add PAGE_ALIGNED() helper

    To test whether an address is aligned to PAGE_SIZE.

    Cc: HATAYAMA Daisuke <[email protected]>
    Cc: "Eric W. Biederman" <[email protected]>,
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>

Signed-off-by: Baoquan He <[email protected]>
---
 include/linux/mm.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 21c2c99..8d490e0 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -55,6 +55,9 @@ extern int overcommit_kbytes_handler(struct ctl_table *, int, 
void __user *,
 /* 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
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to