Commit c2938eeb authored by Mike Rapoport's avatar Mike Rapoport Committed by Linus Torvalds

arm, s390, unicore32: remove oneliner wrappers for memblock_alloc()

arm, s390 and unicore32 use oneliner wrappers for memblock_alloc().
Replace their usage with direct call to memblock_alloc().

Link: http://lkml.kernel.org/r/1546248566-14910-7-git-send-email-rppt@linux.ibm.comSigned-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
Suggested-by: default avatarChristoph Hellwig <hch@infradead.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Greentime Hu <green.hu@gmail.com>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Mark Salter <msalter@redhat.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Rich Felker <dalias@libc.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Cc: Vincent Chen <deanbo422@gmail.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b63a07d6
...@@ -719,14 +719,9 @@ EXPORT_SYMBOL(phys_mem_access_prot); ...@@ -719,14 +719,9 @@ EXPORT_SYMBOL(phys_mem_access_prot);
#define vectors_base() (vectors_high() ? 0xffff0000 : 0) #define vectors_base() (vectors_high() ? 0xffff0000 : 0)
static void __init *early_alloc_aligned(unsigned long sz, unsigned long align)
{
return memblock_alloc(sz, align);
}
static void __init *early_alloc(unsigned long sz) static void __init *early_alloc(unsigned long sz)
{ {
return early_alloc_aligned(sz, sz); return memblock_alloc(sz, sz);
} }
static void *__init late_alloc(unsigned long sz) static void *__init late_alloc(unsigned long sz)
...@@ -998,7 +993,7 @@ void __init iotable_init(struct map_desc *io_desc, int nr) ...@@ -998,7 +993,7 @@ void __init iotable_init(struct map_desc *io_desc, int nr)
if (!nr) if (!nr)
return; return;
svm = early_alloc_aligned(sizeof(*svm) * nr, __alignof__(*svm)); svm = memblock_alloc(sizeof(*svm) * nr, __alignof__(*svm));
for (md = io_desc; nr; md++, nr--) { for (md = io_desc; nr; md++, nr--) {
create_mapping(md); create_mapping(md);
...@@ -1020,7 +1015,7 @@ void __init vm_reserve_area_early(unsigned long addr, unsigned long size, ...@@ -1020,7 +1015,7 @@ void __init vm_reserve_area_early(unsigned long addr, unsigned long size,
struct vm_struct *vm; struct vm_struct *vm;
struct static_vm *svm; struct static_vm *svm;
svm = early_alloc_aligned(sizeof(*svm), __alignof__(*svm)); svm = memblock_alloc(sizeof(*svm), __alignof__(*svm));
vm = &svm->vm; vm = &svm->vm;
vm->addr = (void *)addr; vm->addr = (void *)addr;
......
...@@ -57,14 +57,6 @@ EXPORT_SYMBOL(__node_distance); ...@@ -57,14 +57,6 @@ EXPORT_SYMBOL(__node_distance);
int numa_debug_enabled; int numa_debug_enabled;
/*
* alloc_node_data() - Allocate node data
*/
static __init pg_data_t *alloc_node_data(void)
{
return memblock_alloc(sizeof(pg_data_t), 8);
}
/* /*
* numa_setup_memory() - Assign bootmem to nodes * numa_setup_memory() - Assign bootmem to nodes
* *
...@@ -101,7 +93,7 @@ static void __init numa_setup_memory(void) ...@@ -101,7 +93,7 @@ static void __init numa_setup_memory(void)
/* Allocate and fill out node_data */ /* Allocate and fill out node_data */
for (nid = 0; nid < MAX_NUMNODES; nid++) for (nid = 0; nid < MAX_NUMNODES; nid++)
NODE_DATA(nid) = alloc_node_data(); NODE_DATA(nid) = memblock_alloc(sizeof(pg_data_t), 8);
for_each_online_node(nid) { for_each_online_node(nid) {
unsigned long start_pfn, end_pfn; unsigned long start_pfn, end_pfn;
......
...@@ -141,16 +141,12 @@ static void __init build_mem_type_table(void) ...@@ -141,16 +141,12 @@ static void __init build_mem_type_table(void)
#define vectors_base() (vectors_high() ? 0xffff0000 : 0) #define vectors_base() (vectors_high() ? 0xffff0000 : 0)
static void __init *early_alloc(unsigned long sz)
{
return memblock_alloc(sz, sz);
}
static pte_t * __init early_pte_alloc(pmd_t *pmd, unsigned long addr, static pte_t * __init early_pte_alloc(pmd_t *pmd, unsigned long addr,
unsigned long prot) unsigned long prot)
{ {
if (pmd_none(*pmd)) { if (pmd_none(*pmd)) {
pte_t *pte = early_alloc(PTRS_PER_PTE * sizeof(pte_t)); pte_t *pte = memblock_alloc(PTRS_PER_PTE * sizeof(pte_t),
PTRS_PER_PTE * sizeof(pte_t));
__pmd_populate(pmd, __pa(pte) | prot); __pmd_populate(pmd, __pa(pte) | prot);
} }
BUG_ON(pmd_bad(*pmd)); BUG_ON(pmd_bad(*pmd));
...@@ -352,7 +348,7 @@ static void __init devicemaps_init(void) ...@@ -352,7 +348,7 @@ static void __init devicemaps_init(void)
/* /*
* Allocate the vector page early. * Allocate the vector page early.
*/ */
vectors = early_alloc(PAGE_SIZE); vectors = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
for (addr = VMALLOC_END; addr; addr += PGDIR_SIZE) for (addr = VMALLOC_END; addr; addr += PGDIR_SIZE)
pmd_clear(pmd_off_k(addr)); pmd_clear(pmd_off_k(addr));
...@@ -429,7 +425,7 @@ void __init paging_init(void) ...@@ -429,7 +425,7 @@ void __init paging_init(void)
top_pmd = pmd_off_k(0xffff0000); top_pmd = pmd_off_k(0xffff0000);
/* allocate the zero page. */ /* allocate the zero page. */
zero_page = early_alloc(PAGE_SIZE); zero_page = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
bootmem_init(); bootmem_init();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment