From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755364Ab3AQWyk (ORCPT ); Thu, 17 Jan 2013 17:54:40 -0500 Received: from e39.co.us.ibm.com ([32.97.110.160]:47005 "EHLO e39.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752229Ab3AQWyh (ORCPT ); Thu, 17 Jan 2013 17:54:37 -0500 From: Cody P Schafer To: Linux MM , David Hansen Cc: LKML , Andrew Morton , Catalin Marinas , Cody P Schafer , Cody P Schafer Subject: [PATCH 5/9] mmzone: add pgdat_{end_pfn,is_empty}() helpers & consolidate. Date: Thu, 17 Jan 2013 14:52:57 -0800 Message-Id: <1358463181-17956-6-git-send-email-cody@linux.vnet.ibm.com> X-Mailer: git-send-email 1.8.0.3 In-Reply-To: <1358463181-17956-1-git-send-email-cody@linux.vnet.ibm.com> References: <1358463181-17956-1-git-send-email-cody@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13011722-3620-0000-0000-000000ED08A3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Cody P Schafer Add pgdat_end_pfn() and pgdat_is_empty() helpers which match the similar zone_*() functions. Change node_end_pfn() to be a wrapper of pgdat_end_pfn(). Signed-off-by: Cody P Schafer --- include/linux/mmzone.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 696cb7c..d7abff0 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -772,11 +772,17 @@ typedef struct pglist_data { #define nid_page_nr(nid, pagenr) pgdat_page_nr(NODE_DATA(nid),(pagenr)) #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) +#define node_end_pfn(nid) pgdat_end_pfn(NODE_DATA(nid)) -#define node_end_pfn(nid) ({\ - pg_data_t *__pgdat = NODE_DATA(nid);\ - __pgdat->node_start_pfn + __pgdat->node_spanned_pages;\ -}) +static inline unsigned long pgdat_end_pfn(pg_data_t *pgdat) +{ + return pgdat->node_start_pfn + pgdat->node_spanned_pages; +} + +static inline bool pgdat_is_empty(pg_data_t *pgdat) +{ + return !pgdat->node_start_pfn && !pgdat->node_spanned_pages; +} #include -- 1.8.0.3 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx114.postini.com [74.125.245.114]) by kanga.kvack.org (Postfix) with SMTP id 445BC6B0010 for ; Thu, 17 Jan 2013 17:54:34 -0500 (EST) Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 17 Jan 2013 17:54:33 -0500 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 53CD4C90026 for ; Thu, 17 Jan 2013 17:54:30 -0500 (EST) Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r0HMsTQV360584 for ; Thu, 17 Jan 2013 17:54:30 -0500 Received: from d03av05.boulder.ibm.com (loopback [127.0.0.1]) by d03av05.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r0HMsQmc022014 for ; Thu, 17 Jan 2013 15:54:29 -0700 From: Cody P Schafer Subject: [PATCH 5/9] mmzone: add pgdat_{end_pfn,is_empty}() helpers & consolidate. Date: Thu, 17 Jan 2013 14:52:57 -0800 Message-Id: <1358463181-17956-6-git-send-email-cody@linux.vnet.ibm.com> In-Reply-To: <1358463181-17956-1-git-send-email-cody@linux.vnet.ibm.com> References: <1358463181-17956-1-git-send-email-cody@linux.vnet.ibm.com> Sender: owner-linux-mm@kvack.org List-ID: To: Linux MM , David Hansen Cc: LKML , Andrew Morton , Catalin Marinas , Cody P Schafer , Cody P Schafer From: Cody P Schafer Add pgdat_end_pfn() and pgdat_is_empty() helpers which match the similar zone_*() functions. Change node_end_pfn() to be a wrapper of pgdat_end_pfn(). Signed-off-by: Cody P Schafer --- include/linux/mmzone.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 696cb7c..d7abff0 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -772,11 +772,17 @@ typedef struct pglist_data { #define nid_page_nr(nid, pagenr) pgdat_page_nr(NODE_DATA(nid),(pagenr)) #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) +#define node_end_pfn(nid) pgdat_end_pfn(NODE_DATA(nid)) -#define node_end_pfn(nid) ({\ - pg_data_t *__pgdat = NODE_DATA(nid);\ - __pgdat->node_start_pfn + __pgdat->node_spanned_pages;\ -}) +static inline unsigned long pgdat_end_pfn(pg_data_t *pgdat) +{ + return pgdat->node_start_pfn + pgdat->node_spanned_pages; +} + +static inline bool pgdat_is_empty(pg_data_t *pgdat) +{ + return !pgdat->node_start_pfn && !pgdat->node_spanned_pages; +} #include -- 1.8.0.3 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org