mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
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>
This commit is contained in:
committed by
Linus Torvalds
parent
9a8dd708d5
commit
eb31d559f1
@@ -857,7 +857,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)
|
||||
*/
|
||||
boot_alias_start = phys_to_idmap(start);
|
||||
if (arm_has_idmap_alias() && boot_alias_start != IDMAP_INVALID_ADDR) {
|
||||
res = memblock_virt_alloc(sizeof(*res), 0);
|
||||
res = memblock_alloc(sizeof(*res), 0);
|
||||
res->name = "System RAM (boot alias)";
|
||||
res->start = boot_alias_start;
|
||||
res->end = phys_to_idmap(end);
|
||||
@@ -865,7 +865,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)
|
||||
request_resource(&iomem_resource, res);
|
||||
}
|
||||
|
||||
res = memblock_virt_alloc(sizeof(*res), 0);
|
||||
res = memblock_alloc(sizeof(*res), 0);
|
||||
res->name = "System RAM";
|
||||
res->start = start;
|
||||
res->end = end;
|
||||
|
||||
@@ -726,7 +726,7 @@ static int __init _setup_clkctrl_provider(struct device_node *np)
|
||||
u64 size;
|
||||
int i;
|
||||
|
||||
provider = memblock_virt_alloc(sizeof(*provider), 0);
|
||||
provider = memblock_alloc(sizeof(*provider), 0);
|
||||
if (!provider)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -736,12 +736,12 @@ static int __init _setup_clkctrl_provider(struct device_node *np)
|
||||
of_property_count_elems_of_size(np, "reg", sizeof(u32)) / 2;
|
||||
|
||||
provider->addr =
|
||||
memblock_virt_alloc(sizeof(void *) * provider->num_addrs, 0);
|
||||
memblock_alloc(sizeof(void *) * provider->num_addrs, 0);
|
||||
if (!provider->addr)
|
||||
return -ENOMEM;
|
||||
|
||||
provider->size =
|
||||
memblock_virt_alloc(sizeof(u32) * provider->num_addrs, 0);
|
||||
memblock_alloc(sizeof(u32) * provider->num_addrs, 0);
|
||||
if (!provider->size)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ static pgd_t tmp_pg_dir[PTRS_PER_PGD] __initdata __aligned(PGD_SIZE);
|
||||
|
||||
static phys_addr_t __init kasan_alloc_zeroed_page(int node)
|
||||
{
|
||||
void *p = memblock_virt_alloc_try_nid(PAGE_SIZE, PAGE_SIZE,
|
||||
void *p = memblock_alloc_try_nid(PAGE_SIZE, PAGE_SIZE,
|
||||
__pa(MAX_DMA_ADDRESS),
|
||||
MEMBLOCK_ALLOC_ACCESSIBLE, node);
|
||||
return __pa(p);
|
||||
|
||||
@@ -168,7 +168,7 @@ static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size,
|
||||
{
|
||||
int nid = early_cpu_to_node(cpu);
|
||||
|
||||
return memblock_virt_alloc_try_nid(size, align,
|
||||
return memblock_alloc_try_nid(size, align,
|
||||
__pa(MAX_DMA_ADDRESS), MEMBLOCK_ALLOC_ACCESSIBLE, nid);
|
||||
}
|
||||
|
||||
|
||||
@@ -859,7 +859,7 @@ static void __init arch_mem_init(char **cmdline_p)
|
||||
* Prevent memblock from allocating high memory.
|
||||
* This cannot be done before max_low_pfn is detected, so up
|
||||
* to this point is possible to only reserve physical memory
|
||||
* with memblock_reserve; memblock_virt_alloc* can be used
|
||||
* with memblock_reserve; memblock_alloc* can be used
|
||||
* only after this point
|
||||
*/
|
||||
memblock_set_current_limit(PFN_PHYS(max_low_pfn));
|
||||
|
||||
@@ -203,7 +203,7 @@ pci_create_OF_bus_map(void)
|
||||
struct property* of_prop;
|
||||
struct device_node *dn;
|
||||
|
||||
of_prop = memblock_virt_alloc(sizeof(struct property) + 256, 0);
|
||||
of_prop = memblock_alloc(sizeof(struct property) + 256, 0);
|
||||
dn = of_find_node_by_path("/");
|
||||
if (dn) {
|
||||
memset(of_prop, -1, sizeof(struct property) + 256);
|
||||
|
||||
@@ -14,7 +14,7 @@ void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask)
|
||||
if (slab_is_available())
|
||||
p = kzalloc(size, mask);
|
||||
else {
|
||||
p = memblock_virt_alloc(size, 0);
|
||||
p = memblock_alloc(size, 0);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -461,10 +461,10 @@ void __init mmu_context_init(void)
|
||||
/*
|
||||
* Allocate the maps used by context management
|
||||
*/
|
||||
context_map = memblock_virt_alloc(CTX_MAP_SIZE, 0);
|
||||
context_mm = memblock_virt_alloc(sizeof(void *) * (LAST_CONTEXT + 1), 0);
|
||||
context_map = memblock_alloc(CTX_MAP_SIZE, 0);
|
||||
context_mm = memblock_alloc(sizeof(void *) * (LAST_CONTEXT + 1), 0);
|
||||
#ifdef CONFIG_SMP
|
||||
stale_map[boot_cpuid] = memblock_virt_alloc(CTX_MAP_SIZE, 0);
|
||||
stale_map[boot_cpuid] = memblock_alloc(CTX_MAP_SIZE, 0);
|
||||
|
||||
cpuhp_setup_state_nocalls(CPUHP_POWERPC_MMU_CTX_PREPARE,
|
||||
"powerpc/mmu/ctx:prepare",
|
||||
|
||||
@@ -513,7 +513,7 @@ static int __init core99_nvram_setup(struct device_node *dp, unsigned long addr)
|
||||
printk(KERN_ERR "nvram: no address\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
nvram_image = memblock_virt_alloc(NVRAM_SIZE, 0);
|
||||
nvram_image = memblock_alloc(NVRAM_SIZE, 0);
|
||||
nvram_data = ioremap(addr, NVRAM_SIZE*2);
|
||||
nvram_naddrs = 1; /* Make sure we get the correct case */
|
||||
|
||||
|
||||
@@ -3770,7 +3770,7 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
|
||||
phb_id = be64_to_cpup(prop64);
|
||||
pr_debug(" PHB-ID : 0x%016llx\n", phb_id);
|
||||
|
||||
phb = memblock_virt_alloc(sizeof(*phb), 0);
|
||||
phb = memblock_alloc(sizeof(*phb), 0);
|
||||
|
||||
/* Allocate PCI controller */
|
||||
phb->hose = hose = pcibios_alloc_controller(np);
|
||||
@@ -3816,7 +3816,7 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
|
||||
else
|
||||
phb->diag_data_size = PNV_PCI_DIAG_BUF_SIZE;
|
||||
|
||||
phb->diag_data = memblock_virt_alloc(phb->diag_data_size, 0);
|
||||
phb->diag_data = memblock_alloc(phb->diag_data_size, 0);
|
||||
|
||||
/* Parse 32-bit and IO ranges (if any) */
|
||||
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,
|
||||
}
|
||||
pemap_off = size;
|
||||
size += phb->ioda.total_pe_num * sizeof(struct pnv_ioda_pe);
|
||||
aux = memblock_virt_alloc(size, 0);
|
||||
aux = memblock_alloc(size, 0);
|
||||
phb->ioda.pe_alloc = aux;
|
||||
phb->ioda.m64_segmap = aux + m64map_off;
|
||||
phb->ioda.m32_segmap = aux + m32map_off;
|
||||
|
||||
@@ -126,7 +126,7 @@ static void __init prealloc(struct ps3_prealloc *p)
|
||||
if (!p->size)
|
||||
return;
|
||||
|
||||
p->address = memblock_virt_alloc(p->size, p->align);
|
||||
p->address = memblock_alloc(p->size, p->align);
|
||||
|
||||
printk(KERN_INFO "%s: %lu bytes at %p\n", p->name, p->size,
|
||||
p->address);
|
||||
|
||||
@@ -128,7 +128,7 @@ int __ref msi_bitmap_alloc(struct msi_bitmap *bmp, unsigned int irq_count,
|
||||
if (bmp->bitmap_from_slab)
|
||||
bmp->bitmap = kzalloc(size, GFP_KERNEL);
|
||||
else {
|
||||
bmp->bitmap = memblock_virt_alloc(size, 0);
|
||||
bmp->bitmap = memblock_alloc(size, 0);
|
||||
/* the bitmap won't be freed from memblock allocator */
|
||||
kmemleak_not_leak(bmp->bitmap);
|
||||
}
|
||||
|
||||
@@ -378,7 +378,7 @@ static void __init setup_lowcore(void)
|
||||
* Setup lowcore for boot cpu
|
||||
*/
|
||||
BUILD_BUG_ON(sizeof(struct lowcore) != LC_PAGES * PAGE_SIZE);
|
||||
lc = memblock_virt_alloc_low(sizeof(*lc), sizeof(*lc));
|
||||
lc = memblock_alloc_low(sizeof(*lc), sizeof(*lc));
|
||||
lc->restart_psw.mask = PSW_KERNEL_BITS;
|
||||
lc->restart_psw.addr = (unsigned long) restart_int_handler;
|
||||
lc->external_new_psw.mask = PSW_KERNEL_BITS |
|
||||
@@ -422,7 +422,7 @@ static void __init setup_lowcore(void)
|
||||
* Allocate the global restart stack which is the same for
|
||||
* all CPUs in cast *one* of them does a PSW restart.
|
||||
*/
|
||||
restart_stack = memblock_virt_alloc(THREAD_SIZE, THREAD_SIZE);
|
||||
restart_stack = memblock_alloc(THREAD_SIZE, THREAD_SIZE);
|
||||
restart_stack += STACK_INIT_OFFSET;
|
||||
|
||||
/*
|
||||
@@ -488,7 +488,7 @@ static void __init setup_resources(void)
|
||||
bss_resource.end = (unsigned long) __bss_stop - 1;
|
||||
|
||||
for_each_memblock(memory, reg) {
|
||||
res = memblock_virt_alloc(sizeof(*res), 8);
|
||||
res = memblock_alloc(sizeof(*res), 8);
|
||||
res->flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM;
|
||||
|
||||
res->name = "System RAM";
|
||||
@@ -502,7 +502,7 @@ static void __init setup_resources(void)
|
||||
std_res->start > res->end)
|
||||
continue;
|
||||
if (std_res->end > res->end) {
|
||||
sub_res = memblock_virt_alloc(sizeof(*sub_res), 8);
|
||||
sub_res = memblock_alloc(sizeof(*sub_res), 8);
|
||||
*sub_res = *std_res;
|
||||
sub_res->end = res->end;
|
||||
std_res->start = res->end + 1;
|
||||
|
||||
@@ -761,7 +761,7 @@ void __init smp_detect_cpus(void)
|
||||
u16 address;
|
||||
|
||||
/* Get CPU information */
|
||||
info = memblock_virt_alloc(sizeof(*info), 8);
|
||||
info = memblock_alloc(sizeof(*info), 8);
|
||||
smp_get_core_info(info, 1);
|
||||
/* Find boot CPU type */
|
||||
if (sclp.has_core_type) {
|
||||
|
||||
@@ -519,7 +519,7 @@ static void __init alloc_masks(struct sysinfo_15_1_x *info,
|
||||
nr_masks *= info->mag[TOPOLOGY_NR_MAG - offset - 1 - i];
|
||||
nr_masks = max(nr_masks, 1);
|
||||
for (i = 0; i < nr_masks; i++) {
|
||||
mask->next = memblock_virt_alloc(sizeof(*mask->next), 8);
|
||||
mask->next = memblock_alloc(sizeof(*mask->next), 8);
|
||||
mask = mask->next;
|
||||
}
|
||||
}
|
||||
@@ -537,7 +537,7 @@ void __init topology_init_early(void)
|
||||
}
|
||||
if (!MACHINE_HAS_TOPOLOGY)
|
||||
goto out;
|
||||
tl_info = memblock_virt_alloc(PAGE_SIZE, PAGE_SIZE);
|
||||
tl_info = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
|
||||
info = tl_info;
|
||||
store_topology(info);
|
||||
pr_info("The CPU configuration topology of the machine is: %d %d %d %d %d %d / %d\n",
|
||||
|
||||
@@ -313,7 +313,7 @@ static void __ref create_core_to_node_map(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
emu_cores = memblock_virt_alloc(sizeof(*emu_cores), 8);
|
||||
emu_cores = memblock_alloc(sizeof(*emu_cores), 8);
|
||||
for (i = 0; i < ARRAY_SIZE(emu_cores->to_node_id); i++)
|
||||
emu_cores->to_node_id[i] = NODE_ID_FREE;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ struct toptree __ref *toptree_alloc(int level, int id)
|
||||
if (slab_is_available())
|
||||
res = kzalloc(sizeof(*res), GFP_KERNEL);
|
||||
else
|
||||
res = memblock_virt_alloc(sizeof(*res), 8);
|
||||
res = memblock_alloc(sizeof(*res), 8);
|
||||
if (!res)
|
||||
return res;
|
||||
|
||||
|
||||
@@ -28,10 +28,10 @@ static p4d_t tmp_p4d_table[MAX_PTRS_PER_P4D] __initdata __aligned(PAGE_SIZE);
|
||||
static __init void *early_alloc(size_t size, int nid, bool panic)
|
||||
{
|
||||
if (panic)
|
||||
return memblock_virt_alloc_try_nid(size, size,
|
||||
return memblock_alloc_try_nid(size, size,
|
||||
__pa(MAX_DMA_ADDRESS), BOOTMEM_ALLOC_ACCESSIBLE, nid);
|
||||
else
|
||||
return memblock_virt_alloc_try_nid_nopanic(size, size,
|
||||
return memblock_alloc_try_nid_nopanic(size, size,
|
||||
__pa(MAX_DMA_ADDRESS), BOOTMEM_ALLOC_ACCESSIBLE, nid);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ static void __init populate(void *start, void *end)
|
||||
unsigned long vaddr = (unsigned long)start;
|
||||
pgd_t *pgd = pgd_offset_k(vaddr);
|
||||
pmd_t *pmd = pmd_offset(pgd, vaddr);
|
||||
pte_t *pte = memblock_virt_alloc(n_pages * sizeof(pte_t), PAGE_SIZE);
|
||||
pte_t *pte = memblock_alloc(n_pages * sizeof(pte_t), PAGE_SIZE);
|
||||
|
||||
pr_debug("%s: %p - %p\n", __func__, start, end);
|
||||
|
||||
|
||||
@@ -342,7 +342,7 @@ void __init omap2_clk_legacy_provider_init(int index, void __iomem *mem)
|
||||
{
|
||||
struct clk_iomap *io;
|
||||
|
||||
io = memblock_virt_alloc(sizeof(*io), 0);
|
||||
io = memblock_alloc(sizeof(*io), 0);
|
||||
|
||||
io->mem = mem;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user