Skip to content

Commit eb31d55

Browse files
rppttorvalds
authored andcommitted
memblock: remove _virt from APIs returning virtual address
The conversion is done using sed -i 's@memblock_virt_alloc@memblock_alloc@g' \ $(git grep -l memblock_virt_alloc) Link: http://lkml.kernel.org/r/1536927045-23536-8-git-send-email-rppt@linux.vnet.ibm.com Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.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 Hocko <mhocko@suse.com> 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 9a8dd70 commit eb31d55

37 files changed

Lines changed: 105 additions & 105 deletions

File tree

‎arch/arm/kernel/setup.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -857,15 +857,15 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)
857857
*/
858858
boot_alias_start = phys_to_idmap(start);
859859
if (arm_has_idmap_alias() && boot_alias_start != IDMAP_INVALID_ADDR) {
860-
res = memblock_virt_alloc(sizeof(*res), 0);
860+
res = memblock_alloc(sizeof(*res), 0);
861861
res->name = "System RAM (boot alias)";
862862
res->start = boot_alias_start;
863863
res->end = phys_to_idmap(end);
864864
res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
865865
request_resource(&iomem_resource, res);
866866
}
867867

868-
res = memblock_virt_alloc(sizeof(*res), 0);
868+
res = memblock_alloc(sizeof(*res), 0);
869869
res->name = "System RAM";
870870
res->start = start;
871871
res->end = end;

‎arch/arm/mach-omap2/omap_hwmod.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ static int __init _setup_clkctrl_provider(struct device_node *np)
726726
u64 size;
727727
int i;
728728

729-
provider = memblock_virt_alloc(sizeof(*provider), 0);
729+
provider = memblock_alloc(sizeof(*provider), 0);
730730
if (!provider)
731731
return -ENOMEM;
732732

@@ -736,12 +736,12 @@ static int __init _setup_clkctrl_provider(struct device_node *np)
736736
of_property_count_elems_of_size(np, "reg", sizeof(u32)) / 2;
737737

738738
provider->addr =
739-
memblock_virt_alloc(sizeof(void *) * provider->num_addrs, 0);
739+
memblock_alloc(sizeof(void *) * provider->num_addrs, 0);
740740
if (!provider->addr)
741741
return -ENOMEM;
742742

743743
provider->size =
744-
memblock_virt_alloc(sizeof(u32) * provider->num_addrs, 0);
744+
memblock_alloc(sizeof(u32) * provider->num_addrs, 0);
745745
if (!provider->size)
746746
return -ENOMEM;
747747

‎arch/arm64/mm/kasan_init.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static pgd_t tmp_pg_dir[PTRS_PER_PGD] __initdata __aligned(PGD_SIZE);
3838

3939
static phys_addr_t __init kasan_alloc_zeroed_page(int node)
4040
{
41-
void *p = memblock_virt_alloc_try_nid(PAGE_SIZE, PAGE_SIZE,
41+
void *p = memblock_alloc_try_nid(PAGE_SIZE, PAGE_SIZE,
4242
__pa(MAX_DMA_ADDRESS),
4343
MEMBLOCK_ALLOC_ACCESSIBLE, node);
4444
return __pa(p);

‎arch/arm64/mm/numa.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size,
168168
{
169169
int nid = early_cpu_to_node(cpu);
170170

171-
return memblock_virt_alloc_try_nid(size, align,
171+
return memblock_alloc_try_nid(size, align,
172172
__pa(MAX_DMA_ADDRESS), MEMBLOCK_ALLOC_ACCESSIBLE, nid);
173173
}
174174

‎arch/mips/kernel/setup.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ static void __init arch_mem_init(char **cmdline_p)
859859
* Prevent memblock from allocating high memory.
860860
* This cannot be done before max_low_pfn is detected, so up
861861
* to this point is possible to only reserve physical memory
862-
* with memblock_reserve; memblock_virt_alloc* can be used
862+
* with memblock_reserve; memblock_alloc* can be used
863863
* only after this point
864864
*/
865865
memblock_set_current_limit(PFN_PHYS(max_low_pfn));

‎arch/powerpc/kernel/pci_32.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ pci_create_OF_bus_map(void)
203203
struct property* of_prop;
204204
struct device_node *dn;
205205

206-
of_prop = memblock_virt_alloc(sizeof(struct property) + 256, 0);
206+
of_prop = memblock_alloc(sizeof(struct property) + 256, 0);
207207
dn = of_find_node_by_path("/");
208208
if (dn) {
209209
memset(of_prop, -1, sizeof(struct property) + 256);

‎arch/powerpc/lib/alloc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask)
1414
if (slab_is_available())
1515
p = kzalloc(size, mask);
1616
else {
17-
p = memblock_virt_alloc(size, 0);
17+
p = memblock_alloc(size, 0);
1818
}
1919
return p;
2020
}

‎arch/powerpc/mm/mmu_context_nohash.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,10 +461,10 @@ void __init mmu_context_init(void)
461461
/*
462462
* Allocate the maps used by context management
463463
*/
464-
context_map = memblock_virt_alloc(CTX_MAP_SIZE, 0);
465-
context_mm = memblock_virt_alloc(sizeof(void *) * (LAST_CONTEXT + 1), 0);
464+
context_map = memblock_alloc(CTX_MAP_SIZE, 0);
465+
context_mm = memblock_alloc(sizeof(void *) * (LAST_CONTEXT + 1), 0);
466466
#ifdef CONFIG_SMP
467-
stale_map[boot_cpuid] = memblock_virt_alloc(CTX_MAP_SIZE, 0);
467+
stale_map[boot_cpuid] = memblock_alloc(CTX_MAP_SIZE, 0);
468468

469469
cpuhp_setup_state_nocalls(CPUHP_POWERPC_MMU_CTX_PREPARE,
470470
"powerpc/mmu/ctx:prepare",

‎arch/powerpc/platforms/powermac/nvram.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ static int __init core99_nvram_setup(struct device_node *dp, unsigned long addr)
513513
printk(KERN_ERR "nvram: no address\n");
514514
return -EINVAL;
515515
}
516-
nvram_image = memblock_virt_alloc(NVRAM_SIZE, 0);
516+
nvram_image = memblock_alloc(NVRAM_SIZE, 0);
517517
nvram_data = ioremap(addr, NVRAM_SIZE*2);
518518
nvram_naddrs = 1; /* Make sure we get the correct case */
519519

‎arch/powerpc/platforms/powernv/pci-ioda.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3770,7 +3770,7 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
37703770
phb_id = be64_to_cpup(prop64);
37713771
pr_debug(" PHB-ID : 0x%016llx\n", phb_id);
37723772

3773-
phb = memblock_virt_alloc(sizeof(*phb), 0);
3773+
phb = memblock_alloc(sizeof(*phb), 0);
37743774

37753775
/* Allocate PCI controller */
37763776
phb->hose = hose = pcibios_alloc_controller(np);
@@ -3816,7 +3816,7 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
38163816
else
38173817
phb->diag_data_size = PNV_PCI_DIAG_BUF_SIZE;
38183818

3819-
phb->diag_data = memblock_virt_alloc(phb->diag_data_size, 0);
3819+
phb->diag_data = memblock_alloc(phb->diag_data_size, 0);
38203820

38213821
/* Parse 32-bit and IO ranges (if any) */
38223822
pci_process_bridge_OF_ranges(hose, np, !hose->global_number);
@@ -3875,7 +3875,7 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
38753875
}
38763876
pemap_off = size;
38773877
size += phb->ioda.total_pe_num * sizeof(struct pnv_ioda_pe);
3878-
aux = memblock_virt_alloc(size, 0);
3878+
aux = memblock_alloc(size, 0);
38793879
phb->ioda.pe_alloc = aux;
38803880
phb->ioda.m64_segmap = aux + m64map_off;
38813881
phb->ioda.m32_segmap = aux + m32map_off;

0 commit comments

Comments
 (0)