Skip to content

Commit f9b18db

Browse files
htejunH. Peter Anvin
authored andcommitted
memblock: Don't allow archs to override memblock_nid_range()
memblock_nid_range() is used to implement memblock_[try_]alloc_nid(). The generic version determines the range by walking early_node_map with for_each_mem_pfn_range(). The generic version is defined __weak to allow arch override. Currently, only sparc overrides it; however, with the previous update to the generic implementation, there isn't much to be gained with arch override. Sparc would behave exactly the same with the generic implementation. This patch disallows arch override for memblock_nid_range() and make both generic and sparc versions static. sparc is only compile tested. Signed-off-by: Tejun Heo <tj@kernel.org> Link: http://lkml.kernel.org/r/1310460395-30913-6-git-send-email-tj@kernel.org Cc: "David S. Miller" <davem@davemloft.net> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
1 parent b2fea98 commit f9b18db

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

‎arch/sparc/mm/init_64.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ static int find_node(unsigned long addr)
785785
return -1;
786786
}
787787

788-
u64 memblock_nid_range(u64 start, u64 end, int *nid)
788+
static u64 memblock_nid_range(u64 start, u64 end, int *nid)
789789
{
790790
*nid = find_node(start);
791791
start += PAGE_SIZE;
@@ -803,7 +803,7 @@ u64 memblock_nid_range(u64 start, u64 end, int *nid)
803803
return start;
804804
}
805805
#else
806-
u64 memblock_nid_range(u64 start, u64 end, int *nid)
806+
static u64 memblock_nid_range(u64 start, u64 end, int *nid)
807807
{
808808
*nid = 0;
809809
return end;

‎include/linux/memblock.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ extern int memblock_is_region_reserved(phys_addr_t base, phys_addr_t size);
8989
extern void memblock_dump_all(void);
9090

9191
/* Provided by the architecture */
92-
extern phys_addr_t memblock_nid_range(phys_addr_t start, phys_addr_t end, int *nid);
9392
extern int memblock_memory_can_coalesce(phys_addr_t addr1, phys_addr_t size1,
9493
phys_addr_t addr2, phys_addr_t size2);
9594

‎mm/memblock.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ phys_addr_t __init memblock_alloc(phys_addr_t size, phys_addr_t align)
508508
* have been done to populate it.
509509
*/
510510

511-
phys_addr_t __weak __init memblock_nid_range(phys_addr_t start, phys_addr_t end, int *nid)
511+
static phys_addr_t __init memblock_nid_range(phys_addr_t start, phys_addr_t end, int *nid)
512512
{
513513
#ifdef CONFIG_ARCH_POPULATES_NODE_MAP
514514
unsigned long start_pfn, end_pfn;

0 commit comments

Comments
 (0)