Skip to content

Commit 9a8dd70

Browse files
rppttorvalds
authored andcommitted
memblock: rename memblock_alloc{_nid,_try_nid} to memblock_phys_alloc*
Make it explicit that the caller gets a physical address rather than a virtual one. This will also allow using meblock_alloc prefix for memblock allocations returning virtual address, which is done in the following patches. The conversion is done using the following semantic patch: @@ expression e1, e2, e3; @@ ( - memblock_alloc(e1, e2) + memblock_phys_alloc(e1, e2) | - memblock_alloc_nid(e1, e2, e3) + memblock_phys_alloc_nid(e1, e2, e3) | - memblock_alloc_try_nid(e1, e2, e3) + memblock_phys_alloc_try_nid(e1, e2, e3) ) Link: http://lkml.kernel.org/r/1536927045-23536-7-git-send-email-rppt@linux.vnet.ibm.com Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Chris Zankel <chris@zankel.net> Cc: "David S. Miller" <davem@davemloft.net> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Greentime Hu <green.hu@gmail.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Guan Xuetao <gxt@pku.edu.cn> Cc: Ingo Molnar <mingo@redhat.com> Cc: "James E.J. Bottomley" <jejb@parisc-linux.org> Cc: Jonas Bonn <jonas@southpole.se> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Ley Foon Tan <lftan@altera.com> Cc: Mark Salter <msalter@redhat.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Matt Turner <mattst88@gmail.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Michal Simek <monstr@monstr.eu> Cc: Palmer Dabbelt <palmer@sifive.com> Cc: Paul Burton <paul.burton@mips.com> Cc: Richard Kuo <rkuo@codeaurora.org> Cc: Richard Weinberger <richard@nod.at> Cc: Rich Felker <dalias@libc.org> Cc: Russell King <linux@armlinux.org.uk> Cc: Serge Semin <fancer.lancer@gmail.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tony Luck <tony.luck@intel.com> Cc: Vineet Gupta <vgupta@synopsys.com> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent b146ada commit 9a8dd70

File tree

30 files changed

+50
-51
lines changed

30 files changed

+50
-51
lines changed

arch/arm/mm/mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ EXPORT_SYMBOL(phys_mem_access_prot);
721721

722722
static void __init *early_alloc_aligned(unsigned long sz, unsigned long align)
723723
{
724-
void *ptr = __va(memblock_alloc(sz, align));
724+
void *ptr = __va(memblock_phys_alloc(sz, align));
725725
memset(ptr, 0, sz);
726726
return ptr;
727727
}

arch/arm64/mm/mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ static phys_addr_t __init early_pgtable_alloc(void)
101101
phys_addr_t phys;
102102
void *ptr;
103103

104-
phys = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
104+
phys = memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE);
105105

106106
/*
107107
* The FIX_{PGD,PUD,PMD} slots may be in active use, but the FIX_PTE

arch/arm64/mm/numa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ static void __init setup_node_data(int nid, u64 start_pfn, u64 end_pfn)
237237
if (start_pfn >= end_pfn)
238238
pr_info("Initmem setup node %d [<memory-less node>]\n", nid);
239239

240-
nd_pa = memblock_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid);
240+
nd_pa = memblock_phys_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid);
241241
nd = __va(nd_pa);
242242

243243
/* report and initialize */

arch/c6x/mm/dma-coherent.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ void __init coherent_mem_init(phys_addr_t start, u32 size)
135135
if (dma_size & (PAGE_SIZE - 1))
136136
++dma_pages;
137137

138-
bitmap_phys = memblock_alloc(BITS_TO_LONGS(dma_pages) * sizeof(long),
139-
sizeof(long));
138+
bitmap_phys = memblock_phys_alloc(BITS_TO_LONGS(dma_pages) * sizeof(long),
139+
sizeof(long));
140140

141141
dma_bitmap = phys_to_virt(bitmap_phys);
142142
memset(dma_bitmap, 0, dma_pages * PAGE_SIZE);

arch/nds32/mm/init.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static void __init map_ram(void)
8181
}
8282

8383
/* Alloc one page for holding PTE's... */
84-
pte = (pte_t *) __va(memblock_alloc(PAGE_SIZE, PAGE_SIZE));
84+
pte = (pte_t *) __va(memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE));
8585
memset(pte, 0, PAGE_SIZE);
8686
set_pmd(pme, __pmd(__pa(pte) + _PAGE_KERNEL_TABLE));
8787

@@ -114,7 +114,7 @@ static void __init fixedrange_init(void)
114114
pgd = swapper_pg_dir + pgd_index(vaddr);
115115
pud = pud_offset(pgd, vaddr);
116116
pmd = pmd_offset(pud, vaddr);
117-
fixmap_pmd_p = (pmd_t *) __va(memblock_alloc(PAGE_SIZE, PAGE_SIZE));
117+
fixmap_pmd_p = (pmd_t *) __va(memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE));
118118
memset(fixmap_pmd_p, 0, PAGE_SIZE);
119119
set_pmd(pmd, __pmd(__pa(fixmap_pmd_p) + _PAGE_KERNEL_TABLE));
120120

@@ -127,7 +127,7 @@ static void __init fixedrange_init(void)
127127
pgd = swapper_pg_dir + pgd_index(vaddr);
128128
pud = pud_offset(pgd, vaddr);
129129
pmd = pmd_offset(pud, vaddr);
130-
pte = (pte_t *) __va(memblock_alloc(PAGE_SIZE, PAGE_SIZE));
130+
pte = (pte_t *) __va(memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE));
131131
memset(pte, 0, PAGE_SIZE);
132132
set_pmd(pmd, __pmd(__pa(pte) + _PAGE_KERNEL_TABLE));
133133
pkmap_page_table = pte;
@@ -153,7 +153,7 @@ void __init paging_init(void)
153153
fixedrange_init();
154154

155155
/* allocate space for empty_zero_page */
156-
zero_page = __va(memblock_alloc(PAGE_SIZE, PAGE_SIZE));
156+
zero_page = __va(memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE));
157157
memset(zero_page, 0, PAGE_SIZE);
158158
zone_sizes_init();
159159

arch/openrisc/mm/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static void __init map_ram(void)
106106
}
107107

108108
/* Alloc one page for holding PTE's... */
109-
pte = (pte_t *) __va(memblock_alloc(PAGE_SIZE, PAGE_SIZE));
109+
pte = (pte_t *) __va(memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE));
110110
set_pmd(pme, __pmd(_KERNPG_TABLE + __pa(pte)));
111111

112112
/* Fill the newly allocated page with PTE'S */

arch/openrisc/mm/ioremap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ pte_t __ref *pte_alloc_one_kernel(struct mm_struct *mm,
126126
if (likely(mem_init_done)) {
127127
pte = (pte_t *) __get_free_page(GFP_KERNEL);
128128
} else {
129-
pte = (pte_t *) __va(memblock_alloc(PAGE_SIZE, PAGE_SIZE));
129+
pte = (pte_t *) __va(memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE));
130130
}
131131

132132
if (pte)

arch/powerpc/kernel/dt_cpu_ftrs.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,9 +1008,7 @@ static int __init dt_cpu_ftrs_scan_callback(unsigned long node, const char
10081008
/* Count and allocate space for cpu features */
10091009
of_scan_flat_dt_subnodes(node, count_cpufeatures_subnodes,
10101010
&nr_dt_cpu_features);
1011-
dt_cpu_features = __va(
1012-
memblock_alloc(sizeof(struct dt_cpu_feature)*
1013-
nr_dt_cpu_features, PAGE_SIZE));
1011+
dt_cpu_features = __va(memblock_phys_alloc(sizeof(struct dt_cpu_feature) * nr_dt_cpu_features, PAGE_SIZE));
10141012

10151013
cpufeatures_setup_start(isa);
10161014

arch/powerpc/kernel/paca.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ void __init allocate_paca_ptrs(void)
198198
paca_nr_cpu_ids = nr_cpu_ids;
199199

200200
paca_ptrs_size = sizeof(struct paca_struct *) * nr_cpu_ids;
201-
paca_ptrs = __va(memblock_alloc(paca_ptrs_size, 0));
201+
paca_ptrs = __va(memblock_phys_alloc(paca_ptrs_size, 0));
202202
memset(paca_ptrs, 0x88, paca_ptrs_size);
203203
}
204204

arch/powerpc/kernel/prom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static void __init move_device_tree(void)
126126
if ((memory_limit && (start + size) > PHYSICAL_START + memory_limit) ||
127127
overlaps_crashkernel(start, size) ||
128128
overlaps_initrd(start, size)) {
129-
p = __va(memblock_alloc(size, PAGE_SIZE));
129+
p = __va(memblock_phys_alloc(size, PAGE_SIZE));
130130
memcpy(p, initial_boot_params, size);
131131
initial_boot_params = p;
132132
DBG("Moved device tree to 0x%p\n", p);

arch/powerpc/kernel/setup-common.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,8 +460,7 @@ void __init smp_setup_cpu_maps(void)
460460

461461
DBG("smp_setup_cpu_maps()\n");
462462

463-
cpu_to_phys_id = __va(memblock_alloc(nr_cpu_ids * sizeof(u32),
464-
__alignof__(u32)));
463+
cpu_to_phys_id = __va(memblock_phys_alloc(nr_cpu_ids * sizeof(u32), __alignof__(u32)));
465464
memset(cpu_to_phys_id, 0, nr_cpu_ids * sizeof(u32));
466465

467466
for_each_node_by_type(dn, "cpu") {

arch/powerpc/kernel/setup_32.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ void __init irqstack_early_init(void)
206206
* as the memblock is limited to lowmem by default */
207207
for_each_possible_cpu(i) {
208208
softirq_ctx[i] = (struct thread_info *)
209-
__va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
209+
__va(memblock_phys_alloc(THREAD_SIZE, THREAD_SIZE));
210210
hardirq_ctx[i] = (struct thread_info *)
211-
__va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
211+
__va(memblock_phys_alloc(THREAD_SIZE, THREAD_SIZE));
212212
}
213213
}
214214

@@ -227,12 +227,12 @@ void __init exc_lvl_early_init(void)
227227
#endif
228228

229229
critirq_ctx[hw_cpu] = (struct thread_info *)
230-
__va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
230+
__va(memblock_phys_alloc(THREAD_SIZE, THREAD_SIZE));
231231
#ifdef CONFIG_BOOKE
232232
dbgirq_ctx[hw_cpu] = (struct thread_info *)
233-
__va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
233+
__va(memblock_phys_alloc(THREAD_SIZE, THREAD_SIZE));
234234
mcheckirq_ctx[hw_cpu] = (struct thread_info *)
235-
__va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
235+
__va(memblock_phys_alloc(THREAD_SIZE, THREAD_SIZE));
236236
#endif
237237
}
238238
}

arch/powerpc/mm/numa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ static void __init setup_node_data(int nid, u64 start_pfn, u64 end_pfn)
788788
void *nd;
789789
int tnid;
790790

791-
nd_pa = memblock_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid);
791+
nd_pa = memblock_phys_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid);
792792
nd = __va(nd_pa);
793793

794794
/* report and initialize */

arch/powerpc/mm/pgtable_32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ __ref pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
5050
if (slab_is_available()) {
5151
pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO);
5252
} else {
53-
pte = __va(memblock_alloc(PAGE_SIZE, PAGE_SIZE));
53+
pte = __va(memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE));
5454
if (pte)
5555
clear_page(pte);
5656
}

arch/powerpc/mm/ppc_mmu_32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ void __init MMU_init_hw(void)
224224
* Find some memory for the hash table.
225225
*/
226226
if ( ppc_md.progress ) ppc_md.progress("hash:find piece", 0x322);
227-
Hash = __va(memblock_alloc(Hash_size, Hash_size));
227+
Hash = __va(memblock_phys_alloc(Hash_size, Hash_size));
228228
memset(Hash, 0, Hash_size);
229229
_SDR1 = __pa(Hash) | SDR1_LOW_BITS;
230230

arch/powerpc/platforms/pasemi/iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static int __init iob_init(struct device_node *dn)
213213
pr_info("IOBMAP L2 allocated at: %p\n", iob_l2_base);
214214

215215
/* Allocate a spare page to map all invalid IOTLB pages. */
216-
tmp = memblock_alloc(IOBMAP_PAGE_SIZE, IOBMAP_PAGE_SIZE);
216+
tmp = memblock_phys_alloc(IOBMAP_PAGE_SIZE, IOBMAP_PAGE_SIZE);
217217
if (!tmp)
218218
panic("IOBMAP: Cannot allocate spare page!");
219219
/* Empty l1 is marked invalid */

arch/powerpc/platforms/powernv/opal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ int __init early_init_dt_scan_recoverable_ranges(unsigned long node,
171171
/*
172172
* Allocate a buffer to hold the MC recoverable ranges.
173173
*/
174-
mc_recoverable_range =__va(memblock_alloc(size, __alignof__(u64)));
174+
mc_recoverable_range =__va(memblock_phys_alloc(size, __alignof__(u64)));
175175
memset(mc_recoverable_range, 0, size);
176176

177177
for (i = 0; i < mc_recoverable_range_len; i++) {

arch/powerpc/sysdev/dart_iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ static void allocate_dart(void)
261261
* that to work around what looks like a problem with the HT bridge
262262
* prefetching into invalid pages and corrupting data
263263
*/
264-
tmp = memblock_alloc(DART_PAGE_SIZE, DART_PAGE_SIZE);
264+
tmp = memblock_phys_alloc(DART_PAGE_SIZE, DART_PAGE_SIZE);
265265
dart_emptyval = DARTMAP_VALID | ((tmp >> DART_PAGE_SHIFT) &
266266
DARTMAP_RPNMASK);
267267

arch/s390/kernel/crash_dump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ struct save_area * __init save_area_alloc(bool is_boot_cpu)
6161
{
6262
struct save_area *sa;
6363

64-
sa = (void *) memblock_alloc(sizeof(*sa), 8);
64+
sa = (void *) memblock_phys_alloc(sizeof(*sa), 8);
6565
if (is_boot_cpu)
6666
list_add(&sa->list, &dump_save_areas);
6767
else

arch/s390/kernel/setup.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,8 @@ static void __init setup_randomness(void)
967967
{
968968
struct sysinfo_3_2_2 *vmms;
969969

970-
vmms = (struct sysinfo_3_2_2 *) memblock_alloc(PAGE_SIZE, PAGE_SIZE);
970+
vmms = (struct sysinfo_3_2_2 *) memblock_phys_alloc(PAGE_SIZE,
971+
PAGE_SIZE);
971972
if (stsi(vmms, 3, 2, 2) == 0 && vmms->count)
972973
add_device_randomness(&vmms->vm, sizeof(vmms->vm[0]) * vmms->count);
973974
memblock_free((unsigned long) vmms, PAGE_SIZE);

arch/s390/mm/vmem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static void __ref *vmem_alloc_pages(unsigned int order)
3636

3737
if (slab_is_available())
3838
return (void *)__get_free_pages(GFP_KERNEL, order);
39-
return (void *) memblock_alloc(size, size);
39+
return (void *) memblock_phys_alloc(size, size);
4040
}
4141

4242
void *vmem_crst_alloc(unsigned long val)
@@ -57,7 +57,7 @@ pte_t __ref *vmem_pte_alloc(void)
5757
if (slab_is_available())
5858
pte = (pte_t *) page_table_alloc(&init_mm);
5959
else
60-
pte = (pte_t *) memblock_alloc(size, size);
60+
pte = (pte_t *) memblock_phys_alloc(size, size);
6161
if (!pte)
6262
return NULL;
6363
memset64((u64 *)pte, _PAGE_INVALID, PTRS_PER_PTE);

arch/s390/numa/numa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static __init pg_data_t *alloc_node_data(void)
6464
{
6565
pg_data_t *res;
6666

67-
res = (pg_data_t *) memblock_alloc(sizeof(pg_data_t), 8);
67+
res = (pg_data_t *) memblock_phys_alloc(sizeof(pg_data_t), 8);
6868
memset(res, 0, sizeof(pg_data_t));
6969
return res;
7070
}

arch/sparc/kernel/mdesc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static struct mdesc_handle * __init mdesc_memblock_alloc(unsigned int mdesc_size
170170
mdesc_size);
171171
alloc_size = PAGE_ALIGN(handle_size);
172172

173-
paddr = memblock_alloc(alloc_size, PAGE_SIZE);
173+
paddr = memblock_phys_alloc(alloc_size, PAGE_SIZE);
174174

175175
hp = NULL;
176176
if (paddr) {

arch/sparc/kernel/prom_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
void * __init prom_early_alloc(unsigned long size)
3636
{
37-
unsigned long paddr = memblock_alloc(size, SMP_CACHE_BYTES);
37+
unsigned long paddr = memblock_phys_alloc(size, SMP_CACHE_BYTES);
3838
void *ret;
3939

4040
if (!paddr) {

arch/sparc/mm/init_64.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,8 @@ static void __init allocate_node_data(int nid)
10921092
#ifdef CONFIG_NEED_MULTIPLE_NODES
10931093
unsigned long paddr;
10941094

1095-
paddr = memblock_alloc_try_nid(sizeof(struct pglist_data), SMP_CACHE_BYTES, nid);
1095+
paddr = memblock_phys_alloc_try_nid(sizeof(struct pglist_data),
1096+
SMP_CACHE_BYTES, nid);
10961097
if (!paddr) {
10971098
prom_printf("Cannot allocate pglist_data for nid[%d]\n", nid);
10981099
prom_halt();
@@ -1266,8 +1267,8 @@ static int __init grab_mlgroups(struct mdesc_handle *md)
12661267
if (!count)
12671268
return -ENOENT;
12681269

1269-
paddr = memblock_alloc(count * sizeof(struct mdesc_mlgroup),
1270-
SMP_CACHE_BYTES);
1270+
paddr = memblock_phys_alloc(count * sizeof(struct mdesc_mlgroup),
1271+
SMP_CACHE_BYTES);
12711272
if (!paddr)
12721273
return -ENOMEM;
12731274

@@ -1307,8 +1308,8 @@ static int __init grab_mblocks(struct mdesc_handle *md)
13071308
if (!count)
13081309
return -ENOENT;
13091310

1310-
paddr = memblock_alloc(count * sizeof(struct mdesc_mblock),
1311-
SMP_CACHE_BYTES);
1311+
paddr = memblock_phys_alloc(count * sizeof(struct mdesc_mblock),
1312+
SMP_CACHE_BYTES);
13121313
if (!paddr)
13131314
return -ENOMEM;
13141315

arch/unicore32/mm/mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static void __init build_mem_type_table(void)
144144

145145
static void __init *early_alloc(unsigned long sz)
146146
{
147-
void *ptr = __va(memblock_alloc(sz, sz));
147+
void *ptr = __va(memblock_phys_alloc(sz, sz));
148148
memset(ptr, 0, sz);
149149
return ptr;
150150
}

arch/x86/mm/numa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static void __init alloc_node_data(int nid)
196196
* Allocate node data. Try node-local memory and then any node.
197197
* Never allocate in DMA zone.
198198
*/
199-
nd_pa = memblock_alloc_nid(nd_size, SMP_CACHE_BYTES, nid);
199+
nd_pa = memblock_phys_alloc_nid(nd_size, SMP_CACHE_BYTES, nid);
200200
if (!nd_pa) {
201201
nd_pa = __memblock_alloc_base(nd_size, SMP_CACHE_BYTES,
202202
MEMBLOCK_ALLOC_ACCESSIBLE);

drivers/firmware/efi/memmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
static phys_addr_t __init __efi_memmap_alloc_early(unsigned long size)
1717
{
18-
return memblock_alloc(size, 0);
18+
return memblock_phys_alloc(size, 0);
1919
}
2020

2121
static phys_addr_t __init __efi_memmap_alloc_late(unsigned long size)

include/linux/memblock.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,10 @@ static inline int memblock_get_region_node(const struct memblock_region *r)
300300
}
301301
#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
302302

303-
phys_addr_t memblock_alloc_nid(phys_addr_t size, phys_addr_t align, int nid);
304-
phys_addr_t memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, int nid);
303+
phys_addr_t memblock_phys_alloc_nid(phys_addr_t size, phys_addr_t align, int nid);
304+
phys_addr_t memblock_phys_alloc_try_nid(phys_addr_t size, phys_addr_t align, int nid);
305305

306-
phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align);
306+
phys_addr_t memblock_phys_alloc(phys_addr_t size, phys_addr_t align);
307307

308308
/*
309309
* Set the allocation direction to bottom-up or top-down.

mm/memblock.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,7 @@ phys_addr_t __init memblock_alloc_base_nid(phys_addr_t size,
12691269
return memblock_alloc_range_nid(size, align, 0, max_addr, nid, flags);
12701270
}
12711271

1272-
phys_addr_t __init memblock_alloc_nid(phys_addr_t size, phys_addr_t align, int nid)
1272+
phys_addr_t __init memblock_phys_alloc_nid(phys_addr_t size, phys_addr_t align, int nid)
12731273
{
12741274
enum memblock_flags flags = choose_memblock_flags();
12751275
phys_addr_t ret;
@@ -1304,14 +1304,14 @@ phys_addr_t __init memblock_alloc_base(phys_addr_t size, phys_addr_t align, phys
13041304
return alloc;
13051305
}
13061306

1307-
phys_addr_t __init memblock_alloc(phys_addr_t size, phys_addr_t align)
1307+
phys_addr_t __init memblock_phys_alloc(phys_addr_t size, phys_addr_t align)
13081308
{
13091309
return memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ACCESSIBLE);
13101310
}
13111311

1312-
phys_addr_t __init memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, int nid)
1312+
phys_addr_t __init memblock_phys_alloc_try_nid(phys_addr_t size, phys_addr_t align, int nid)
13131313
{
1314-
phys_addr_t res = memblock_alloc_nid(size, align, nid);
1314+
phys_addr_t res = memblock_phys_alloc_nid(size, align, nid);
13151315

13161316
if (res)
13171317
return res;

0 commit comments

Comments
 (0)