Skip to content

Commit 3ecc683

Browse files
rppttorvalds
authored andcommitted
memblock: rename memblock_free to memblock_phys_free
Since memblock_free() operates on a physical range, make its name reflect it and rename it to memblock_phys_free(), so it will be a logical counterpart to memblock_phys_alloc(). The callers are updated with the below semantic patch: @@ expression addr; expression size; @@ - memblock_free(addr, size); + memblock_phys_free(addr, size); Link: https://lkml.kernel.org/r/20210930185031.18648-6-rppt@kernel.org Signed-off-by: Mike Rapoport <rppt@linux.ibm.com> Cc: Christophe Leroy <christophe.leroy@csgroup.eu> Cc: Juergen Gross <jgross@suse.com> Cc: Shahab Vahedi <Shahab.Vahedi@synopsys.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 621d973 commit 3ecc683

45 files changed

Lines changed: 79 additions & 76 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/alpha/kernel/core_irongate.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ albacore_init_arch(void)
233233
unsigned long size;
234234

235235
size = initrd_end - initrd_start;
236-
memblock_free(__pa(initrd_start), PAGE_ALIGN(size));
236+
memblock_phys_free(__pa(initrd_start),
237+
PAGE_ALIGN(size));
237238
if (!move_initrd(pci_mem))
238239
printk("irongate_init_arch: initrd too big "
239240
"(%ldK)\ndisabling initrd\n",

‎arch/arc/mm/init.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ static void __init highmem_init(void)
173173
#ifdef CONFIG_HIGHMEM
174174
unsigned long tmp;
175175

176-
memblock_free(high_mem_start, high_mem_sz);
176+
memblock_phys_free(high_mem_start, high_mem_sz);
177177
for (tmp = min_high_pfn; tmp < max_high_pfn; tmp++)
178178
free_highmem_page(pfn_to_page(tmp));
179179
#endif

‎arch/arm/mach-hisi/platmcpm.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ static int __init hip04_smp_init(void)
339339
err_sysctrl:
340340
iounmap(relocation);
341341
err_reloc:
342-
memblock_free(hip04_boot_method[0], hip04_boot_method[1]);
342+
memblock_phys_free(hip04_boot_method[0], hip04_boot_method[1]);
343343
err:
344344
return ret;
345345
}

‎arch/arm/mm/init.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align)
158158
panic("Failed to steal %pa bytes at %pS\n",
159159
&size, (void *)_RET_IP_);
160160

161-
memblock_free(phys, size);
161+
memblock_phys_free(phys, size);
162162
memblock_remove(phys, size);
163163

164164
return phys;

‎arch/arm64/mm/mmu.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,8 +738,8 @@ void __init paging_init(void)
738738
cpu_replace_ttbr1(lm_alias(swapper_pg_dir));
739739
init_mm.pgd = swapper_pg_dir;
740740

741-
memblock_free(__pa_symbol(init_pg_dir),
742-
__pa_symbol(init_pg_end) - __pa_symbol(init_pg_dir));
741+
memblock_phys_free(__pa_symbol(init_pg_dir),
742+
__pa_symbol(init_pg_end) - __pa_symbol(init_pg_dir));
743743

744744
memblock_allow_resize();
745745
}

‎arch/mips/mm/init.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size,
529529

530530
static void __init pcpu_fc_free(void *ptr, size_t size)
531531
{
532-
memblock_free(__pa(ptr), size);
532+
memblock_phys_free(__pa(ptr), size);
533533
}
534534

535535
void __init setup_per_cpu_areas(void)

‎arch/mips/sgi-ip30/ip30-setup.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ static void __init ip30_mem_init(void)
6969
total_mem += size;
7070

7171
if (addr >= IP30_REAL_MEMORY_START)
72-
memblock_free(addr, size);
72+
memblock_phys_free(addr, size);
7373
else if ((addr + size) > IP30_REAL_MEMORY_START)
74-
memblock_free(IP30_REAL_MEMORY_START,
75-
size - IP30_MAX_PROM_MEMORY);
74+
memblock_phys_free(IP30_REAL_MEMORY_START,
75+
size - IP30_MAX_PROM_MEMORY);
7676
}
7777
pr_info("Detected %luMB of physical memory.\n", MEM_SHIFT(total_mem));
7878
}

‎arch/powerpc/kernel/dt_cpu_ftrs.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,8 +1095,8 @@ static int __init dt_cpu_ftrs_scan_callback(unsigned long node, const char
10951095

10961096
cpufeatures_setup_finished();
10971097

1098-
memblock_free(__pa(dt_cpu_features),
1099-
sizeof(struct dt_cpu_feature)*nr_dt_cpu_features);
1098+
memblock_phys_free(__pa(dt_cpu_features),
1099+
sizeof(struct dt_cpu_feature) * nr_dt_cpu_features);
11001100

11011101
return 0;
11021102
}

‎arch/powerpc/kernel/paca.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,17 +322,17 @@ void __init free_unused_pacas(void)
322322

323323
new_ptrs_size = sizeof(struct paca_struct *) * nr_cpu_ids;
324324
if (new_ptrs_size < paca_ptrs_size)
325-
memblock_free(__pa(paca_ptrs) + new_ptrs_size,
326-
paca_ptrs_size - new_ptrs_size);
325+
memblock_phys_free(__pa(paca_ptrs) + new_ptrs_size,
326+
paca_ptrs_size - new_ptrs_size);
327327

328328
paca_nr_cpu_ids = nr_cpu_ids;
329329
paca_ptrs_size = new_ptrs_size;
330330

331331
#ifdef CONFIG_PPC_BOOK3S_64
332332
if (early_radix_enabled()) {
333333
/* Ugly fixup, see new_slb_shadow() */
334-
memblock_free(__pa(paca_ptrs[boot_cpuid]->slb_shadow_ptr),
335-
sizeof(struct slb_shadow));
334+
memblock_phys_free(__pa(paca_ptrs[boot_cpuid]->slb_shadow_ptr),
335+
sizeof(struct slb_shadow));
336336
paca_ptrs[boot_cpuid]->slb_shadow_ptr = NULL;
337337
}
338338
#endif

‎arch/powerpc/kernel/setup-common.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ static void __init smp_setup_pacas(void)
825825
set_hard_smp_processor_id(cpu, cpu_to_phys_id[cpu]);
826826
}
827827

828-
memblock_free(__pa(cpu_to_phys_id), nr_cpu_ids * sizeof(u32));
828+
memblock_phys_free(__pa(cpu_to_phys_id), nr_cpu_ids * sizeof(u32));
829829
cpu_to_phys_id = NULL;
830830
}
831831
#endif

0 commit comments

Comments
 (0)