Skip to content

Commit c2938ee

Browse files
rppttorvalds
authored andcommitted
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/[email protected] Signed-off-by: Mike Rapoport <[email protected]> Suggested-by: Christoph Hellwig <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Greentime Hu <[email protected]> Cc: Guan Xuetao <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Jonas Bonn <[email protected]> Cc: Mark Salter <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Michal Simek <[email protected]> Cc: Michal Simek <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Rich Felker <[email protected]> Cc: Russell King <[email protected]> Cc: Stafford Horne <[email protected]> Cc: Stefan Kristiansson <[email protected]> Cc: Vincent Chen <[email protected]> Cc: Yoshinori Sato <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent b63a07d commit c2938ee

File tree

3 files changed

+8
-25
lines changed

3 files changed

+8
-25
lines changed

arch/arm/mm/mmu.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -719,14 +719,9 @@ EXPORT_SYMBOL(phys_mem_access_prot);
719719

720720
#define vectors_base() (vectors_high() ? 0xffff0000 : 0)
721721

722-
static void __init *early_alloc_aligned(unsigned long sz, unsigned long align)
723-
{
724-
return memblock_alloc(sz, align);
725-
}
726-
727722
static void __init *early_alloc(unsigned long sz)
728723
{
729-
return early_alloc_aligned(sz, sz);
724+
return memblock_alloc(sz, sz);
730725
}
731726

732727
static void *__init late_alloc(unsigned long sz)
@@ -998,7 +993,7 @@ void __init iotable_init(struct map_desc *io_desc, int nr)
998993
if (!nr)
999994
return;
1000995

1001-
svm = early_alloc_aligned(sizeof(*svm) * nr, __alignof__(*svm));
996+
svm = memblock_alloc(sizeof(*svm) * nr, __alignof__(*svm));
1002997

1003998
for (md = io_desc; nr; md++, nr--) {
1004999
create_mapping(md);
@@ -1020,7 +1015,7 @@ void __init vm_reserve_area_early(unsigned long addr, unsigned long size,
10201015
struct vm_struct *vm;
10211016
struct static_vm *svm;
10221017

1023-
svm = early_alloc_aligned(sizeof(*svm), __alignof__(*svm));
1018+
svm = memblock_alloc(sizeof(*svm), __alignof__(*svm));
10241019

10251020
vm = &svm->vm;
10261021
vm->addr = (void *)addr;

arch/s390/numa/numa.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,6 @@ EXPORT_SYMBOL(__node_distance);
5757

5858
int numa_debug_enabled;
5959

60-
/*
61-
* alloc_node_data() - Allocate node data
62-
*/
63-
static __init pg_data_t *alloc_node_data(void)
64-
{
65-
return memblock_alloc(sizeof(pg_data_t), 8);
66-
}
67-
6860
/*
6961
* numa_setup_memory() - Assign bootmem to nodes
7062
*
@@ -101,7 +93,7 @@ static void __init numa_setup_memory(void)
10193

10294
/* Allocate and fill out node_data */
10395
for (nid = 0; nid < MAX_NUMNODES; nid++)
104-
NODE_DATA(nid) = alloc_node_data();
96+
NODE_DATA(nid) = memblock_alloc(sizeof(pg_data_t), 8);
10597

10698
for_each_online_node(nid) {
10799
unsigned long start_pfn, end_pfn;

arch/unicore32/mm/mmu.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,12 @@ static void __init build_mem_type_table(void)
141141

142142
#define vectors_base() (vectors_high() ? 0xffff0000 : 0)
143143

144-
static void __init *early_alloc(unsigned long sz)
145-
{
146-
return memblock_alloc(sz, sz);
147-
}
148-
149144
static pte_t * __init early_pte_alloc(pmd_t *pmd, unsigned long addr,
150145
unsigned long prot)
151146
{
152147
if (pmd_none(*pmd)) {
153-
pte_t *pte = early_alloc(PTRS_PER_PTE * sizeof(pte_t));
148+
pte_t *pte = memblock_alloc(PTRS_PER_PTE * sizeof(pte_t),
149+
PTRS_PER_PTE * sizeof(pte_t));
154150
__pmd_populate(pmd, __pa(pte) | prot);
155151
}
156152
BUG_ON(pmd_bad(*pmd));
@@ -352,7 +348,7 @@ static void __init devicemaps_init(void)
352348
/*
353349
* Allocate the vector page early.
354350
*/
355-
vectors = early_alloc(PAGE_SIZE);
351+
vectors = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
356352

357353
for (addr = VMALLOC_END; addr; addr += PGDIR_SIZE)
358354
pmd_clear(pmd_off_k(addr));
@@ -429,7 +425,7 @@ void __init paging_init(void)
429425
top_pmd = pmd_off_k(0xffff0000);
430426

431427
/* allocate the zero page. */
432-
zero_page = early_alloc(PAGE_SIZE);
428+
zero_page = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
433429

434430
bootmem_init();
435431

0 commit comments

Comments
 (0)