linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] m68k: mm: Remove superfluous memblock_alloc*() casts
@ 2020-08-26 13:04 Geert Uytterhoeven
  2020-08-26 13:31 ` Mike Rapoport
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2020-08-26 13:04 UTC (permalink / raw)
  To: linux-m68k; +Cc: Greg Ungerer, Mike Rapoport, linux-kernel, Geert Uytterhoeven

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>
---
 arch/m68k/mm/mcfmmu.c   | 2 +-
 arch/m68k/mm/motorola.c | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/m68k/mm/mcfmmu.c b/arch/m68k/mm/mcfmmu.c
index 2b9cb4a622811390..eac9dde65193443e 100644
--- a/arch/m68k/mm/mcfmmu.c
+++ b/arch/m68k/mm/mcfmmu.c
@@ -42,7 +42,7 @@ void __init paging_init(void)
 	unsigned long max_zone_pfn[MAX_NR_ZONES] = { 0 };
 	int i;
 
-	empty_zero_page = (void *) memblock_alloc(PAGE_SIZE, PAGE_SIZE);
+	empty_zero_page = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
 	if (!empty_zero_page)
 		panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
 		      __func__, PAGE_SIZE, PAGE_SIZE);
diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
index a9bdde54ca350197..3a653f0a4188d4af 100644
--- a/arch/m68k/mm/motorola.c
+++ b/arch/m68k/mm/motorola.c
@@ -227,7 +227,7 @@ static pte_t * __init kernel_page_table(void)
 	pte_t *pte_table = last_pte_table;
 
 	if (PAGE_ALIGNED(last_pte_table)) {
-		pte_table = (pte_t *)memblock_alloc_low(PAGE_SIZE, PAGE_SIZE);
+		pte_table = memblock_alloc_low(PAGE_SIZE, PAGE_SIZE);
 		if (!pte_table) {
 			panic("%s: Failed to allocate %lu bytes align=%lx\n",
 					__func__, PAGE_SIZE, PAGE_SIZE);
@@ -275,8 +275,7 @@ static pmd_t * __init kernel_ptr_table(void)
 
 	last_pmd_table += PTRS_PER_PMD;
 	if (PAGE_ALIGNED(last_pmd_table)) {
-		last_pmd_table = (pmd_t *)memblock_alloc_low(PAGE_SIZE,
-							   PAGE_SIZE);
+		last_pmd_table = memblock_alloc_low(PAGE_SIZE, PAGE_SIZE);
 		if (!last_pmd_table)
 			panic("%s: Failed to allocate %lu bytes align=%lx\n",
 			      __func__, PAGE_SIZE, PAGE_SIZE);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] m68k: mm: Remove superfluous memblock_alloc*() casts
  2020-08-26 13:04 [PATCH] m68k: mm: Remove superfluous memblock_alloc*() casts Geert Uytterhoeven
@ 2020-08-26 13:31 ` Mike Rapoport
  2020-08-27  0:13 ` Greg Ungerer
  2020-09-07  8:49 ` Geert Uytterhoeven
  2 siblings, 0 replies; 4+ messages in thread
From: Mike Rapoport @ 2020-08-26 13:31 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-m68k, Greg Ungerer, linux-kernel

On Wed, Aug 26, 2020 at 03:04:44PM +0200, Geert Uytterhoeven wrote:
> 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>

> ---
>  arch/m68k/mm/mcfmmu.c   | 2 +-
>  arch/m68k/mm/motorola.c | 5 ++---
>  2 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/m68k/mm/mcfmmu.c b/arch/m68k/mm/mcfmmu.c
> index 2b9cb4a622811390..eac9dde65193443e 100644
> --- a/arch/m68k/mm/mcfmmu.c
> +++ b/arch/m68k/mm/mcfmmu.c
> @@ -42,7 +42,7 @@ void __init paging_init(void)
>  	unsigned long max_zone_pfn[MAX_NR_ZONES] = { 0 };
>  	int i;
>  
> -	empty_zero_page = (void *) memblock_alloc(PAGE_SIZE, PAGE_SIZE);
> +	empty_zero_page = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
>  	if (!empty_zero_page)
>  		panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
>  		      __func__, PAGE_SIZE, PAGE_SIZE);
> diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
> index a9bdde54ca350197..3a653f0a4188d4af 100644
> --- a/arch/m68k/mm/motorola.c
> +++ b/arch/m68k/mm/motorola.c
> @@ -227,7 +227,7 @@ static pte_t * __init kernel_page_table(void)
>  	pte_t *pte_table = last_pte_table;
>  
>  	if (PAGE_ALIGNED(last_pte_table)) {
> -		pte_table = (pte_t *)memblock_alloc_low(PAGE_SIZE, PAGE_SIZE);
> +		pte_table = memblock_alloc_low(PAGE_SIZE, PAGE_SIZE);
>  		if (!pte_table) {
>  			panic("%s: Failed to allocate %lu bytes align=%lx\n",
>  					__func__, PAGE_SIZE, PAGE_SIZE);
> @@ -275,8 +275,7 @@ static pmd_t * __init kernel_ptr_table(void)
>  
>  	last_pmd_table += PTRS_PER_PMD;
>  	if (PAGE_ALIGNED(last_pmd_table)) {
> -		last_pmd_table = (pmd_t *)memblock_alloc_low(PAGE_SIZE,
> -							   PAGE_SIZE);
> +		last_pmd_table = memblock_alloc_low(PAGE_SIZE, PAGE_SIZE);
>  		if (!last_pmd_table)
>  			panic("%s: Failed to allocate %lu bytes align=%lx\n",
>  			      __func__, PAGE_SIZE, PAGE_SIZE);
> -- 
> 2.17.1
> 

-- 
Sincerely yours,
Mike.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] m68k: mm: Remove superfluous memblock_alloc*() casts
  2020-08-26 13:04 [PATCH] m68k: mm: Remove superfluous memblock_alloc*() casts Geert Uytterhoeven
  2020-08-26 13:31 ` Mike Rapoport
@ 2020-08-27  0:13 ` Greg Ungerer
  2020-09-07  8:49 ` Geert Uytterhoeven
  2 siblings, 0 replies; 4+ messages in thread
From: Greg Ungerer @ 2020-08-27  0:13 UTC (permalink / raw)
  To: Geert Uytterhoeven, linux-m68k; +Cc: Mike Rapoport, linux-kernel

Hi Geert,

On 26/8/20 11:04 pm, Geert Uytterhoeven wrote:
> 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>

Acked-by: Greg Ungerer <gerg@linux-m68k.org>

Regards
Greg


>   arch/m68k/mm/mcfmmu.c   | 2 +-
>   arch/m68k/mm/motorola.c | 5 ++---
>   2 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/m68k/mm/mcfmmu.c b/arch/m68k/mm/mcfmmu.c
> index 2b9cb4a622811390..eac9dde65193443e 100644
> --- a/arch/m68k/mm/mcfmmu.c
> +++ b/arch/m68k/mm/mcfmmu.c
> @@ -42,7 +42,7 @@ void __init paging_init(void)
>   	unsigned long max_zone_pfn[MAX_NR_ZONES] = { 0 };
>   	int i;
>   
> -	empty_zero_page = (void *) memblock_alloc(PAGE_SIZE, PAGE_SIZE);
> +	empty_zero_page = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
>   	if (!empty_zero_page)
>   		panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
>   		      __func__, PAGE_SIZE, PAGE_SIZE);
> diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
> index a9bdde54ca350197..3a653f0a4188d4af 100644
> --- a/arch/m68k/mm/motorola.c
> +++ b/arch/m68k/mm/motorola.c
> @@ -227,7 +227,7 @@ static pte_t * __init kernel_page_table(void)
>   	pte_t *pte_table = last_pte_table;
>   
>   	if (PAGE_ALIGNED(last_pte_table)) {
> -		pte_table = (pte_t *)memblock_alloc_low(PAGE_SIZE, PAGE_SIZE);
> +		pte_table = memblock_alloc_low(PAGE_SIZE, PAGE_SIZE);
>   		if (!pte_table) {
>   			panic("%s: Failed to allocate %lu bytes align=%lx\n",
>   					__func__, PAGE_SIZE, PAGE_SIZE);
> @@ -275,8 +275,7 @@ static pmd_t * __init kernel_ptr_table(void)
>   
>   	last_pmd_table += PTRS_PER_PMD;
>   	if (PAGE_ALIGNED(last_pmd_table)) {
> -		last_pmd_table = (pmd_t *)memblock_alloc_low(PAGE_SIZE,
> -							   PAGE_SIZE);
> +		last_pmd_table = memblock_alloc_low(PAGE_SIZE, PAGE_SIZE);
>   		if (!last_pmd_table)
>   			panic("%s: Failed to allocate %lu bytes align=%lx\n",
>   			      __func__, PAGE_SIZE, PAGE_SIZE);
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] m68k: mm: Remove superfluous memblock_alloc*() casts
  2020-08-26 13:04 [PATCH] m68k: mm: Remove superfluous memblock_alloc*() casts Geert Uytterhoeven
  2020-08-26 13:31 ` Mike Rapoport
  2020-08-27  0:13 ` Greg Ungerer
@ 2020-09-07  8:49 ` Geert Uytterhoeven
  2 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2020-09-07  8:49 UTC (permalink / raw)
  To: linux-m68k; +Cc: Greg Ungerer, Mike Rapoport, Linux Kernel Mailing List

On Wed, Aug 26, 2020 at 3:04 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> 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>

Thanks, queueing in the m68k for-v5.10 branch.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-07  8:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-26 13:04 [PATCH] m68k: mm: Remove superfluous memblock_alloc*() casts Geert Uytterhoeven
2020-08-26 13:31 ` Mike Rapoport
2020-08-27  0:13 ` Greg Ungerer
2020-09-07  8:49 ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).