public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86, mm: clean up setup_node_bootmem
@ 2011-03-03  1:19 Yinghai Lu
  2011-03-03  6:30 ` Tejun Heo
  2011-03-03 20:49 ` David Rientjes
  0 siblings, 2 replies; 5+ messages in thread
From: Yinghai Lu @ 2011-03-03  1:19 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Tejun Heo,
	David Rientjes
  Cc: linux-kernel@vger.kernel.org


only one user now, so change it to static

Also move validity checking into the fuction.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 arch/x86/include/asm/numa_64.h |    2 --
 arch/x86/mm/numa_64.c          |   10 +++-------
 2 files changed, 3 insertions(+), 9 deletions(-)

Index: linux-2.6/arch/x86/include/asm/numa_64.h
===================================================================
--- linux-2.6.orig/arch/x86/include/asm/numa_64.h
+++ linux-2.6/arch/x86/include/asm/numa_64.h
@@ -13,8 +13,6 @@ struct bootnode {
 extern int numa_off;
 
 extern unsigned long numa_free_all_bootmem(void);
-extern void setup_node_bootmem(int nodeid, unsigned long start,
-			       unsigned long end);
 
 #ifdef CONFIG_NUMA
 /*
Index: linux-2.6/arch/x86/mm/numa_64.c
===================================================================
--- linux-2.6.orig/arch/x86/mm/numa_64.c
+++ linux-2.6/arch/x86/mm/numa_64.c
@@ -237,21 +237,18 @@ int __init numa_add_memblk(int nid, u64
 }
 
 /* Initialize bootmem allocator for a node */
-void __init
+static void __init
 setup_node_bootmem(int nodeid, unsigned long start, unsigned long end)
 {
 	unsigned long start_pfn, last_pfn, nodedata_phys;
 	const int pgdat_size = roundup(sizeof(pg_data_t), PAGE_SIZE);
 	int nid;
 
-	if (!end)
-		return;
-
 	/*
 	 * Don't confuse VM with a node that doesn't have the
 	 * minimum amount of memory:
 	 */
-	if (end && (end - start) < NODE_MIN_SIZE)
+	if (end < (start +  NODE_MIN_SIZE))
 		return;
 
 	start = roundup(start, ZONE_ALIGN);
@@ -557,8 +554,7 @@ static int __init numa_register_memblks(
 			end = max(mi->blk[i].end, end);
 		}
 
-		if (start < end)
-			setup_node_bootmem(nid, start, end);
+		setup_node_bootmem(nid, start, end);
 	}
 
 	return 0;

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-03-03 22:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-03  1:19 [PATCH] x86, mm: clean up setup_node_bootmem Yinghai Lu
2011-03-03  6:30 ` Tejun Heo
2011-03-03 20:49 ` David Rientjes
2011-03-03 21:35   ` Yinghai Lu
2011-03-03 22:04     ` David Rientjes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox