diff mbox series

[v6,5/5] RISC-V: Free-up initrd in free_initrd_mem()

Message ID 20190213115301.103989-6-anup.patel@wdc.com (mailing list archive)
State New, archived
Headers show
Series Fixmap support and MM cleanups | expand

Commit Message

Anup Patel Feb. 13, 2019, 11:53 a.m. UTC
We should free-up initrd memory in free_initrd_mem() instead
of doing nothing.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
---
 arch/riscv/mm/init.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Mike Rapoport Feb. 13, 2019, 4:33 p.m. UTC | #1
On Wed, Feb 13, 2019 at 11:53:51AM +0000, Anup Patel wrote:
> We should free-up initrd memory in free_initrd_mem() instead
> of doing nothing.
> 
> Signed-off-by: Anup Patel <anup.patel@wdc.com>

Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>

> ---
>  arch/riscv/mm/init.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index b1167a6f5a92..aabf1869c54b 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -94,8 +94,9 @@ static void __init setup_initrd(void)
>  	initrd_end = 0;
>  }
>  
> -void free_initrd_mem(unsigned long start, unsigned long end)
> +void __init free_initrd_mem(unsigned long start, unsigned long end)
>  {
> +	free_reserved_area((void *)start, (void *)end, -1, "initrd");
>  }
>  #endif /* CONFIG_BLK_DEV_INITRD */
>  
> -- 
> 2.17.1
>
Christoph Hellwig Feb. 13, 2019, 5:50 p.m. UTC | #2
On Wed, Feb 13, 2019 at 11:53:51AM +0000, Anup Patel wrote:
> We should free-up initrd memory in free_initrd_mem() instead
> of doing nothing.
> 
> Signed-off-by: Anup Patel <anup.patel@wdc.com>

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

Note that I just sent out a series that implements a common
free_initrd_mem, so if that gets merged we can eventually remove this
copy entirely.
diff mbox series

Patch

diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index b1167a6f5a92..aabf1869c54b 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -94,8 +94,9 @@  static void __init setup_initrd(void)
 	initrd_end = 0;
 }
 
-void free_initrd_mem(unsigned long start, unsigned long end)
+void __init free_initrd_mem(unsigned long start, unsigned long end)
 {
+	free_reserved_area((void *)start, (void *)end, -1, "initrd");
 }
 #endif /* CONFIG_BLK_DEV_INITRD */