[PATCH] microblaze: Remove zalloc_maybe_bootmem()

Christophe Leroy posted 1 patch 2 years, 4 months ago
arch/microblaze/include/asm/setup.h |  2 --
arch/microblaze/mm/init.c           | 16 ----------------
2 files changed, 18 deletions(-)
[PATCH] microblaze: Remove zalloc_maybe_bootmem()
Posted by Christophe Leroy 2 years, 4 months ago
Last user of zalloc_maybe_bootmem() was removed by
commit 4308e3c9e1ea ("microblaze/PCI: Remove unused allocation & free
of PCI host bridge structure")

Remove it.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 arch/microblaze/include/asm/setup.h |  2 --
 arch/microblaze/mm/init.c           | 16 ----------------
 2 files changed, 18 deletions(-)

diff --git a/arch/microblaze/include/asm/setup.h b/arch/microblaze/include/asm/setup.h
index 3657f5e78a3d..bf2600f75959 100644
--- a/arch/microblaze/include/asm/setup.h
+++ b/arch/microblaze/include/asm/setup.h
@@ -25,7 +25,5 @@ void machine_shutdown(void);
 void machine_halt(void);
 void machine_power_off(void);
 
-extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
-
 # endif /* __ASSEMBLY__ */
 #endif /* _ASM_MICROBLAZE_SETUP_H */
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
index 353fabdfcbc5..3827dc76edd8 100644
--- a/arch/microblaze/mm/init.c
+++ b/arch/microblaze/mm/init.c
@@ -270,22 +270,6 @@ asmlinkage void __init mmu_init(void)
 	memblock_dump_all();
 }
 
-void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask)
-{
-	void *p;
-
-	if (mem_init_done) {
-		p = kzalloc(size, mask);
-	} else {
-		p = memblock_alloc(size, SMP_CACHE_BYTES);
-		if (!p)
-			panic("%s: Failed to allocate %zu bytes\n",
-			      __func__, size);
-	}
-
-	return p;
-}
-
 static const pgprot_t protection_map[16] = {
 	[VM_NONE]					= PAGE_NONE,
 	[VM_READ]					= PAGE_READONLY_X,
-- 
2.41.0
Re: [PATCH] microblaze: Remove zalloc_maybe_bootmem()
Posted by Michal Simek 2 years, 3 months ago

On 8/15/23 20:36, Christophe Leroy wrote:
> Last user of zalloc_maybe_bootmem() was removed by
> commit 4308e3c9e1ea ("microblaze/PCI: Remove unused allocation & free
> of PCI host bridge structure")
> 
> Remove it.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
>   arch/microblaze/include/asm/setup.h |  2 --
>   arch/microblaze/mm/init.c           | 16 ----------------
>   2 files changed, 18 deletions(-)
> 
> diff --git a/arch/microblaze/include/asm/setup.h b/arch/microblaze/include/asm/setup.h
> index 3657f5e78a3d..bf2600f75959 100644
> --- a/arch/microblaze/include/asm/setup.h
> +++ b/arch/microblaze/include/asm/setup.h
> @@ -25,7 +25,5 @@ void machine_shutdown(void);
>   void machine_halt(void);
>   void machine_power_off(void);
>   
> -extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
> -
>   # endif /* __ASSEMBLY__ */
>   #endif /* _ASM_MICROBLAZE_SETUP_H */
> diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
> index 353fabdfcbc5..3827dc76edd8 100644
> --- a/arch/microblaze/mm/init.c
> +++ b/arch/microblaze/mm/init.c
> @@ -270,22 +270,6 @@ asmlinkage void __init mmu_init(void)
>   	memblock_dump_all();
>   }
>   
> -void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask)
> -{
> -	void *p;
> -
> -	if (mem_init_done) {
> -		p = kzalloc(size, mask);
> -	} else {
> -		p = memblock_alloc(size, SMP_CACHE_BYTES);
> -		if (!p)
> -			panic("%s: Failed to allocate %zu bytes\n",
> -			      __func__, size);
> -	}
> -
> -	return p;
> -}
> -
>   static const pgprot_t protection_map[16] = {
>   	[VM_NONE]					= PAGE_NONE,
>   	[VM_READ]					= PAGE_READONLY_X,

Applied.
M

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP/Versal ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal/Versal NET SoCs
TF-A maintainer - Xilinx ZynqMP/Versal/Versal NET SoCs