mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -fixes] riscv: mm: remove redundant parameter of create_fdt_early_page_table
@ 2023-04-26  9:15 Song Shuai
  2023-04-26  9:31 ` Alexandre Ghiti
  2023-04-27 10:11 ` Conor Dooley
  0 siblings, 2 replies; 3+ messages in thread
From: Song Shuai @ 2023-04-26  9:15 UTC (permalink / raw)
  To: paul.walmsley, palmer, aou, alexghiti, heiko, conor.dooley,
	guoren, anshuman.khandual, mick, samuel
  Cc: linux-riscv, linux-kernel, Song Shuai

create_fdt_early_page_table() explicitly uses early_pg_dir for
32-bit ftb mapping and the pgdir parameter is redundant here.
So remove it and its caller.

Signed-off-by: Song Shuai <suagrfillet@gmail.com>
---
 arch/riscv/mm/init.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index 0f14f4a8d179..6ebb75a9a6b9 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -843,8 +843,7 @@ static void __init create_kernel_page_table(pgd_t *pgdir, bool early)
  * this means 2 PMD entries whereas for 32-bit kernel, this is only 1 PGDIR
  * entry.
  */
-static void __init create_fdt_early_page_table(pgd_t *pgdir,
-					       uintptr_t fix_fdt_va,
+static void __init create_fdt_early_page_table(uintptr_t fix_fdt_va,
 					       uintptr_t dtb_pa)
 {
 	uintptr_t pa = dtb_pa & ~(PMD_SIZE - 1);
@@ -1034,8 +1033,7 @@ asmlinkage void __init setup_vm(uintptr_t dtb_pa)
 	create_kernel_page_table(early_pg_dir, true);
 
 	/* Setup early mapping for FDT early scan */
-	create_fdt_early_page_table(early_pg_dir,
-				    __fix_to_virt(FIX_FDT), dtb_pa);
+	create_fdt_early_page_table(__fix_to_virt(FIX_FDT), dtb_pa);
 
 	/*
 	 * Bootime fixmap only can handle PMD_SIZE mapping. Thus, boot-ioremap
-- 
2.20.1


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

* Re: [PATCH -fixes] riscv: mm: remove redundant parameter of create_fdt_early_page_table
  2023-04-26  9:15 [PATCH -fixes] riscv: mm: remove redundant parameter of create_fdt_early_page_table Song Shuai
@ 2023-04-26  9:31 ` Alexandre Ghiti
  2023-04-27 10:11 ` Conor Dooley
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Ghiti @ 2023-04-26  9:31 UTC (permalink / raw)
  To: Song Shuai, paul.walmsley, palmer, aou, alexghiti, heiko,
	conor.dooley, guoren, anshuman.khandual, mick, samuel
  Cc: linux-riscv, linux-kernel

Hi Song,


On 4/26/23 11:15, Song Shuai wrote:
> create_fdt_early_page_table() explicitly uses early_pg_dir for
> 32-bit ftb mapping and the pgdir parameter is redundant here.


s/ftb/fdt


> So remove it and its caller.
>
> Signed-off-by: Song Shuai <suagrfillet@gmail.com>
> ---
>   arch/riscv/mm/init.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index 0f14f4a8d179..6ebb75a9a6b9 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -843,8 +843,7 @@ static void __init create_kernel_page_table(pgd_t *pgdir, bool early)
>    * this means 2 PMD entries whereas for 32-bit kernel, this is only 1 PGDIR
>    * entry.
>    */
> -static void __init create_fdt_early_page_table(pgd_t *pgdir,
> -					       uintptr_t fix_fdt_va,
> +static void __init create_fdt_early_page_table(uintptr_t fix_fdt_va,
>   					       uintptr_t dtb_pa)
>   {
>   	uintptr_t pa = dtb_pa & ~(PMD_SIZE - 1);
> @@ -1034,8 +1033,7 @@ asmlinkage void __init setup_vm(uintptr_t dtb_pa)
>   	create_kernel_page_table(early_pg_dir, true);
>   
>   	/* Setup early mapping for FDT early scan */
> -	create_fdt_early_page_table(early_pg_dir,
> -				    __fix_to_virt(FIX_FDT), dtb_pa);
> +	create_fdt_early_page_table(__fix_to_virt(FIX_FDT), dtb_pa);
>   
>   	/*
>   	 * Bootime fixmap only can handle PMD_SIZE mapping. Thus, boot-ioremap


You're right, it was never used, weird the compiler never complained. 
And the function name clearly indicates it is for early_pg_dir so no 
need for this parameter. You can add:

Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>

Thanks!

Alex


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

* Re: [PATCH -fixes] riscv: mm: remove redundant parameter of create_fdt_early_page_table
  2023-04-26  9:15 [PATCH -fixes] riscv: mm: remove redundant parameter of create_fdt_early_page_table Song Shuai
  2023-04-26  9:31 ` Alexandre Ghiti
@ 2023-04-27 10:11 ` Conor Dooley
  1 sibling, 0 replies; 3+ messages in thread
From: Conor Dooley @ 2023-04-27 10:11 UTC (permalink / raw)
  To: Song Shuai
  Cc: paul.walmsley, palmer, aou, alexghiti, heiko, guoren,
	anshuman.khandual, mick, samuel, linux-riscv, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 463 bytes --]

On Wed, Apr 26, 2023 at 05:15:11PM +0800, Song Shuai wrote:
> create_fdt_early_page_table() explicitly uses early_pg_dir for
> 32-bit ftb mapping and the pgdir parameter is redundant here.
> So remove it and its caller.

"and its caller" sounds like you're removing the caller itself when
that's not what you're doing!
I am certainly not suggesting that you resubmit because of that though.

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

end of thread, other threads:[~2023-04-27 10:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-26  9:15 [PATCH -fixes] riscv: mm: remove redundant parameter of create_fdt_early_page_table Song Shuai
2023-04-26  9:31 ` Alexandre Ghiti
2023-04-27 10:11 ` Conor Dooley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®