diff mbox series

[v5,1/6] RISC-V: Move free_initrd_mem() to kernel/setup.c

Message ID 20190213080647.68204-2-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, 8:07 a.m. UTC
We move free_initrd_mem() to kernel/setup.c so that all initrd related
functions are in one place.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
---
 arch/riscv/kernel/setup.c | 4 ++++
 arch/riscv/mm/init.c      | 7 -------
 2 files changed, 4 insertions(+), 7 deletions(-)

Comments

Mike Rapoport Feb. 13, 2019, 9:59 a.m. UTC | #1
On Wed, Feb 13, 2019 at 08:07:17AM +0000, Anup Patel wrote:
> We move free_initrd_mem() to kernel/setup.c so that all initrd related
> functions are in one place.

A few patches after you move setup_bootmem() that calls setup_initrd() to
mm/init.c. I'd say it makes more sense to move setup_intird() to
mm/init.c.
 
> Signed-off-by: Anup Patel <anup.patel@wdc.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
> ---
>  arch/riscv/kernel/setup.c | 4 ++++
>  arch/riscv/mm/init.c      | 7 -------
>  2 files changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
> index 77564310235f..36f60b4d2147 100644
> --- a/arch/riscv/kernel/setup.c
> +++ b/arch/riscv/kernel/setup.c
> @@ -96,6 +96,10 @@ static void __init setup_initrd(void)
>  	initrd_start = 0;
>  	initrd_end = 0;
>  }
> +
> +void free_initrd_mem(unsigned long start, unsigned long end)
> +{
> +}
>  #endif /* CONFIG_BLK_DEV_INITRD */
>  
>  pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned_bss;
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index 658ebf645f42..504a5e491f5a 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -14,7 +14,6 @@
>  #include <linux/init.h>
>  #include <linux/mm.h>
>  #include <linux/memblock.h>
> -#include <linux/initrd.h>
>  #include <linux/swap.h>
>  #include <linux/sizes.h>
>  
> @@ -64,9 +63,3 @@ void free_initmem(void)
>  {
>  	free_initmem_default(0);
>  }
> -
> -#ifdef CONFIG_BLK_DEV_INITRD
> -void free_initrd_mem(unsigned long start, unsigned long end)
> -{
> -}
> -#endif /* CONFIG_BLK_DEV_INITRD */
> -- 
> 2.17.1
>
Anup Patel Feb. 13, 2019, 11:24 a.m. UTC | #2
> -----Original Message-----
> From: Mike Rapoport [mailto:rppt@linux.ibm.com]
> Sent: Wednesday, February 13, 2019 3:30 PM
> To: Anup Patel <Anup.Patel@wdc.com>
> Cc: Palmer Dabbelt <palmer@sifive.com>; Albert Ou
> <aou@eecs.berkeley.edu>; Atish Patra <Atish.Patra@wdc.com>; Paul
> Walmsley <paul.walmsley@sifive.com>; Christoph Hellwig
> <hch@infradead.org>; linux-riscv@lists.infradead.org; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH v5 1/6] RISC-V: Move free_initrd_mem() to
> kernel/setup.c
> 
> On Wed, Feb 13, 2019 at 08:07:17AM +0000, Anup Patel wrote:
> > We move free_initrd_mem() to kernel/setup.c so that all initrd related
> > functions are in one place.
> 
> A few patches after you move setup_bootmem() that calls setup_initrd() to
> mm/init.c. I'd say it makes more sense to move setup_intird() to mm/init.c.

Makes sense. I will drop this patch and I will move setup_initrd() to
mm/init.c along with setup_bootmem() because setup_bootmem()
depends on setup_initrd().

Regards,
Anup
diff mbox series

Patch

diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index 77564310235f..36f60b4d2147 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -96,6 +96,10 @@  static void __init setup_initrd(void)
 	initrd_start = 0;
 	initrd_end = 0;
 }
+
+void free_initrd_mem(unsigned long start, unsigned long end)
+{
+}
 #endif /* CONFIG_BLK_DEV_INITRD */
 
 pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned_bss;
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index 658ebf645f42..504a5e491f5a 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -14,7 +14,6 @@ 
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/memblock.h>
-#include <linux/initrd.h>
 #include <linux/swap.h>
 #include <linux/sizes.h>
 
@@ -64,9 +63,3 @@  void free_initmem(void)
 {
 	free_initmem_default(0);
 }
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-}
-#endif /* CONFIG_BLK_DEV_INITRD */