* [PATCH 0/2] sparc32: remove redundant memsets after memblock allocations
@ 2026-08-27 14:54 Sang-Heon Jeon
2026-08-27 14:54 ` [PATCH 1/2] sparc32: remove redundant memset in arch_mm_preinit() Sang-Heon Jeon
2026-08-27 14:54 ` [PATCH 2/2] sparc32: remove redundant memset in srmmu_nocache_init() Sang-Heon Jeon
0 siblings, 2 replies; 5+ messages in thread
From: Sang-Heon Jeon @ 2026-08-27 14:54 UTC (permalink / raw)
To: Andreas Larsson, David S. Miller; +Cc: linux-kernel, sparclinux
memblock_alloc() and memblock_alloc_or_panic() return zeroed memory,
so the memsets after the allocations are redundant.
Sang-Heon Jeon (2):
sparc32: remove redundant memset in arch_mm_preinit()
sparc32: remove redundant memset in srmmu_nocache_init()
arch/sparc/mm/init_32.c | 1 -
arch/sparc/mm/srmmu.c | 1 -
2 files changed, 2 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] sparc32: remove redundant memset in arch_mm_preinit()
2026-08-27 14:54 [PATCH 0/2] sparc32: remove redundant memsets after memblock allocations Sang-Heon Jeon
@ 2026-08-27 14:54 ` Sang-Heon Jeon
2026-10-09 14:40 ` Andreas Larsson
2026-08-27 14:54 ` [PATCH 2/2] sparc32: remove redundant memset in srmmu_nocache_init() Sang-Heon Jeon
1 sibling, 1 reply; 5+ messages in thread
From: Sang-Heon Jeon @ 2026-08-27 14:54 UTC (permalink / raw)
To: David S. Miller, Andreas Larsson; +Cc: linux-kernel, sparclinux
memblock_alloc() returns zeroed memory, so the memset after the
allocation is redundant.
No functional change.
Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
arch/sparc/mm/init_32.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c
index e0e66f91ceeb..b4f31d41d665 100644
--- a/arch/sparc/mm/init_32.c
+++ b/arch/sparc/mm/init_32.c
@@ -255,7 +255,6 @@ void __init arch_mm_preinit(void)
prom_printf("mem_init: Cannot alloc valid_addr_bitmap.\n");
prom_halt();
}
- memset(sparc_valid_addr_bitmap, 0, i << 2);
taint_real_pages();
}
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] sparc32: remove redundant memset in srmmu_nocache_init()
2026-08-27 14:54 [PATCH 0/2] sparc32: remove redundant memsets after memblock allocations Sang-Heon Jeon
2026-08-27 14:54 ` [PATCH 1/2] sparc32: remove redundant memset in arch_mm_preinit() Sang-Heon Jeon
@ 2026-08-27 14:54 ` Sang-Heon Jeon
2026-10-09 14:41 ` Andreas Larsson
1 sibling, 1 reply; 5+ messages in thread
From: Sang-Heon Jeon @ 2026-08-27 14:54 UTC (permalink / raw)
To: David S. Miller, Andreas Larsson; +Cc: linux-kernel, sparclinux
memblock_alloc_or_panic() returns zeroed memory, so the memset after
the allocation is redundant.
No functional change.
Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
arch/sparc/mm/srmmu.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index 9a74902ad181..f9a92a07a255 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -279,7 +279,6 @@ static void __init srmmu_nocache_init(void)
srmmu_nocache_pool = memblock_alloc_or_panic(srmmu_nocache_size,
SRMMU_NOCACHE_ALIGN_MAX);
- memset(srmmu_nocache_pool, 0, srmmu_nocache_size);
srmmu_nocache_bitmap =
memblock_alloc_or_panic(BITS_TO_LONGS(bitmap_bits) * sizeof(long),
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] sparc32: remove redundant memset in arch_mm_preinit()
2026-08-27 14:54 ` [PATCH 1/2] sparc32: remove redundant memset in arch_mm_preinit() Sang-Heon Jeon
@ 2026-10-09 14:40 ` Andreas Larsson
0 siblings, 0 replies; 5+ messages in thread
From: Andreas Larsson @ 2026-10-09 14:40 UTC (permalink / raw)
To: Sang-Heon Jeon, David S. Miller; +Cc: linux-kernel, sparclinux
On 2026-08-27 16:54, Sang-Heon Jeon wrote:
> memblock_alloc() returns zeroed memory, so the memset after the
> allocation is redundant.
>
> No functional change.
>
> Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
> ---
> arch/sparc/mm/init_32.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c
> index e0e66f91ceeb..b4f31d41d665 100644
> --- a/arch/sparc/mm/init_32.c
> +++ b/arch/sparc/mm/init_32.c
> @@ -255,7 +255,6 @@ void __init arch_mm_preinit(void)
> prom_printf("mem_init: Cannot alloc valid_addr_bitmap.\n");
> prom_halt();
> }
> - memset(sparc_valid_addr_bitmap, 0, i << 2);
>
> taint_real_pages();
> }
No need for this anymore as this code is gone on my for-next thanks to
commit 91c897e01883 ("sparc32: drop unused valid address bitmap").
Cheers,
Andreas
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] sparc32: remove redundant memset in srmmu_nocache_init()
2026-08-27 14:54 ` [PATCH 2/2] sparc32: remove redundant memset in srmmu_nocache_init() Sang-Heon Jeon
@ 2026-10-09 14:41 ` Andreas Larsson
0 siblings, 0 replies; 5+ messages in thread
From: Andreas Larsson @ 2026-10-09 14:41 UTC (permalink / raw)
To: Sang-Heon Jeon, David S. Miller; +Cc: linux-kernel, sparclinux
On 2026-08-27 16:54, Sang-Heon Jeon wrote:
> memblock_alloc_or_panic() returns zeroed memory, so the memset after
> the allocation is redundant.
>
> No functional change.
>
> Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
> ---
> arch/sparc/mm/srmmu.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
> index 9a74902ad181..f9a92a07a255 100644
> --- a/arch/sparc/mm/srmmu.c
> +++ b/arch/sparc/mm/srmmu.c
> @@ -279,7 +279,6 @@ static void __init srmmu_nocache_init(void)
>
> srmmu_nocache_pool = memblock_alloc_or_panic(srmmu_nocache_size,
> SRMMU_NOCACHE_ALIGN_MAX);
> - memset(srmmu_nocache_pool, 0, srmmu_nocache_size);
>
> srmmu_nocache_bitmap =
> memblock_alloc_or_panic(BITS_TO_LONGS(bitmap_bits) * sizeof(long),
Reviewed-by: Andreas Larsson <andreas@gaisler.com>
Picking this up to my for-next.
Thanks,
Andreas
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-10-09 14:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-27 14:54 [PATCH 0/2] sparc32: remove redundant memsets after memblock allocations Sang-Heon Jeon
2026-08-27 14:54 ` [PATCH 1/2] sparc32: remove redundant memset in arch_mm_preinit() Sang-Heon Jeon
2026-10-09 14:40 ` Andreas Larsson
2026-08-27 14:54 ` [PATCH 2/2] sparc32: remove redundant memset in srmmu_nocache_init() Sang-Heon Jeon
2026-10-09 14:41 ` Andreas Larsson
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®