]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
include/linux/mm.h: add PAGE_ALIGNED() helper
authorAndrew Morton <akpm@linux-foundation.org>
Wed, 19 Jun 2013 00:06:05 +0000 (10:06 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 19 Jun 2013 07:13:04 +0000 (17:13 +1000)
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>
include/linux/mm.h

index 66d881f1d57665b5791d3a5a357c8cbff3d4c9a0..949bd70358954a4435daa7a033c57b3c58398f06 100644 (file)
@@ -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