From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754761AbbGPIsE (ORCPT ); Thu, 16 Jul 2015 04:48:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53366 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752840AbbGPIsA (ORCPT ); Thu, 16 Jul 2015 04:48:00 -0400 From: Baoquan He To: linux-kernel@vger.kernel.org, ncroxon@redhat.com, dyoung@redhat.com, mhuang@redhat.com Cc: Baoquan He Subject: [RHEL6.8 Patch 05/19] include/linux/mm.h: add PAGE_ALIGNED() helper Date: Thu, 16 Jul 2015 16:47:03 +0800 Message-Id: <1437036437-25408-9-git-send-email-bhe@redhat.com> In-Reply-To: <1437036437-25408-1-git-send-email-bhe@redhat.com> References: <1437036437-25408-1-git-send-email-bhe@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Resolves: bz1097904 https://bugzilla.redhat.com/show_bug.cgi?id=1097904 This is back ported from upstream directly. commit 0fa73b86ef0797ca4fde5334117ca0b330f08030 Author: Andrew Morton 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 Cc: "Eric W. Biederman" , Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Baoquan He --- 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