arm, s390, unicore32: remove oneliner wrappers for memblock_alloc()
authorMike Rapoport <rppt@linux.ibm.com>
Fri, 8 Mar 2019 00:31:10 +0000 (16:31 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 8 Mar 2019 02:32:03 +0000 (18:32 -0800)
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.com
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Suggested-by: Christoph 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/arm/mm/mmu.c
arch/s390/numa/numa.c
arch/unicore32/mm/mmu.c

index 0a04c9a5f04265d2d6173b15f6b1bf78d9fe28d4..57de0dde3ae0811a7290ff42578167ebb7dc208c 100644 (file)
@@ -719,14 +719,9 @@ EXPORT_SYMBOL(phys_mem_access_prot);
 
 #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)
 {
-       return early_alloc_aligned(sz, sz);
+       return memblock_alloc(sz, sz);
 }
 
 static void *__init late_alloc(unsigned long sz)
@@ -998,7 +993,7 @@ void __init iotable_init(struct map_desc *io_desc, int nr)
        if (!nr)
                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--) {
                create_mapping(md);
@@ -1020,7 +1015,7 @@ void __init vm_reserve_area_early(unsigned long addr, unsigned long size,
        struct vm_struct *vm;
        struct static_vm *svm;
 
-       svm = early_alloc_aligned(sizeof(*svm), __alignof__(*svm));
+       svm = memblock_alloc(sizeof(*svm), __alignof__(*svm));
 
        vm = &svm->vm;
        vm->addr = (void *)addr;
index 2281a88f261cdd78363085e4638610791c193908..2d1271e2a70db2a73813ce51923bd42ac88d85ef 100644 (file)
@@ -57,14 +57,6 @@ EXPORT_SYMBOL(__node_distance);
 
 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
  *
@@ -101,7 +93,7 @@ static void __init numa_setup_memory(void)
 
        /* Allocate and fill out node_data */
        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) {
                unsigned long start_pfn, end_pfn;
index 50d8c1a39e54b4391a5b587e70a0d8d7c406dc57..a40219291965de0cce772c0c6a2c763358a68b15 100644 (file)
@@ -141,16 +141,12 @@ static void __init build_mem_type_table(void)
 
 #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,
                unsigned long prot)
 {
        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);
        }
        BUG_ON(pmd_bad(*pmd));
@@ -352,7 +348,7 @@ static void __init devicemaps_init(void)
        /*
         * 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)
                pmd_clear(pmd_off_k(addr));
@@ -429,7 +425,7 @@ void __init paging_init(void)
        top_pmd = pmd_off_k(0xffff0000);
 
        /* allocate the zero page. */
-       zero_page = early_alloc(PAGE_SIZE);
+       zero_page = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
 
        bootmem_init();