[PATCH v2 4/6] sparc32: drop unused valid address bitmap

From: Magnus Lindholm

Date: Sun Aug 30 2026 - 08:09:07 EST


sparc_valid_addr_bitmap is populated during early memory setup but never
read. Remove the bitmap, its allocation and the population helper.

Suggested-by: Sam Ravnborg <sam@xxxxxxxxxxxx>
Signed-off-by: Magnus Lindholm <linmag7@xxxxxxxxx>
---
arch/sparc/mm/init_32.c | 36 ------------------------------------
1 file changed, 36 deletions(-)

diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c
index 75050dfbc2ea..6880d9cb30a5 100644
--- a/arch/sparc/mm/init_32.c
+++ b/arch/sparc/mm/init_32.c
@@ -13,7 +13,6 @@
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/errno.h>
-#include <linux/string.h>
#include <linux/types.h>
#include <linux/ptrace.h>
#include <linux/mman.h>
@@ -24,7 +23,6 @@
#include <linux/highmem.h>
#include <linux/memblock.h>
#include <linux/pagemap.h>
-#include <linux/poison.h>
#include <linux/gfp.h>

#include <asm/sections.h>
@@ -37,8 +35,6 @@

#include "mm_32.h"

-static unsigned long *sparc_valid_addr_bitmap;
-
unsigned long phys_base;
EXPORT_SYMBOL(phys_base);

@@ -218,27 +214,8 @@ void __init paging_init(void)
device_scan();
}

-static void __init taint_real_pages(void)
-{
- int i;
-
- for (i = 0; sp_banks[i].num_bytes; i++) {
- unsigned long start, end;
-
- start = sp_banks[i].base_addr;
- end = start + sp_banks[i].num_bytes;
-
- while (start < end) {
- set_bit(start >> 20, sparc_valid_addr_bitmap);
- start += PAGE_SIZE;
- }
- }
-}
-
void __init arch_mm_preinit(void)
{
- int i;
-
if (PKMAP_BASE+LAST_PKMAP*PAGE_SIZE >= FIXADDR_START) {
prom_printf("BUG: fixmap and pkmap areas overlap\n");
prom_printf("pkbase: 0x%lx pkend: 0x%lx fixstart 0x%lx\n",
@@ -248,19 +225,6 @@ void __init arch_mm_preinit(void)
prom_printf("Please mail sparclinux@xxxxxxxxxxxxxxx.\n");
prom_halt();
}
-
- i = last_valid_pfn >> ((20 - PAGE_SHIFT) + 5);
- i += 1;
- sparc_valid_addr_bitmap = (unsigned long *)
- memblock_alloc(i << 2, SMP_CACHE_BYTES);
-
- if (sparc_valid_addr_bitmap == NULL) {
- prom_printf("mem_init: Cannot alloc valid_addr_bitmap.\n");
- prom_halt();
- }
- memset(sparc_valid_addr_bitmap, 0, i << 2);
-
- taint_real_pages();
}

void sparc_flush_page_to_ram(struct page *page)
--
2.43.0