Skip to content

Commit 7e15882

Browse files
committed
m68k: mm: Remove superfluous memblock_alloc*() casts
The return type of memblock_alloc*() is a void pointer, so there is no need to cast it to "void *" or some other pointer type, before assigning it to a pointer variable. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Mike Rapoport <rppt@linux.ibm.com> Acked-by: Greg Ungerer <gerg@linux-m68k.org> Link: https://lore.kernel.org/r/20200826130444.25618-1-geert@linux-m68k.org
1 parent 41f1bf3 commit 7e15882

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

arch/m68k/mm/mcfmmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void __init paging_init(void)
4242
unsigned long max_zone_pfn[MAX_NR_ZONES] = { 0 };
4343
int i;
4444

45-
empty_zero_page = (void *) memblock_alloc(PAGE_SIZE, PAGE_SIZE);
45+
empty_zero_page = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
4646
if (!empty_zero_page)
4747
panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
4848
__func__, PAGE_SIZE, PAGE_SIZE);

arch/m68k/mm/motorola.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ static pte_t * __init kernel_page_table(void)
227227
pte_t *pte_table = last_pte_table;
228228

229229
if (PAGE_ALIGNED(last_pte_table)) {
230-
pte_table = (pte_t *)memblock_alloc_low(PAGE_SIZE, PAGE_SIZE);
230+
pte_table = memblock_alloc_low(PAGE_SIZE, PAGE_SIZE);
231231
if (!pte_table) {
232232
panic("%s: Failed to allocate %lu bytes align=%lx\n",
233233
__func__, PAGE_SIZE, PAGE_SIZE);
@@ -275,8 +275,7 @@ static pmd_t * __init kernel_ptr_table(void)
275275

276276
last_pmd_table += PTRS_PER_PMD;
277277
if (PAGE_ALIGNED(last_pmd_table)) {
278-
last_pmd_table = (pmd_t *)memblock_alloc_low(PAGE_SIZE,
279-
PAGE_SIZE);
278+
last_pmd_table = memblock_alloc_low(PAGE_SIZE, PAGE_SIZE);
280279
if (!last_pmd_table)
281280
panic("%s: Failed to allocate %lu bytes align=%lx\n",
282281
__func__, PAGE_SIZE, PAGE_SIZE);

0 commit comments

Comments
 (0)