From: Cody P Schafer Date: Sat, 23 Feb 2013 00:35:27 +0000 (-0800) Subject: mmzone: add pgdat_{end_pfn,is_empty}() helpers & consolidate. X-Git-Tag: MMI-PSA29.97-13-9~14973^2~33 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=da3649e133948d8b7d8c57b05a33faf62ac2cc7e;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git mmzone: add pgdat_{end_pfn,is_empty}() helpers & consolidate. 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 Cc: David Hansen Cc: Catalin Marinas Cc: Johannes Weiner Cc: Mel Gorman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index cf8925962b68..ede274957e05 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -756,11 +756,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