[PATCH] x86/realmode: Use const and u32 for embedded real-mode data
From: Thorsten Blum
Date: Thu Nov 05 2026 - 13:16:36 EST
Declare the embedded real-mode blob and relocation table as const since
they are not modified.
Also declare the relocation table as a u32 array since it contains
32-bit entries, and remove the cast in setup_real_mode().
No functional change.
Signed-off-by: Thorsten Blum <blum@xxxxxxxxxx>
---
arch/x86/include/asm/realmode.h | 6 +++---
arch/x86/realmode/init.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/x86/include/asm/realmode.h b/arch/x86/include/asm/realmode.h
index e406a1e92c63..e48259f2e503 100644
--- a/arch/x86/include/asm/realmode.h
+++ b/arch/x86/include/asm/realmode.h
@@ -57,7 +57,7 @@ struct trampoline_header {
};
extern struct real_mode_header *real_mode_header;
-extern unsigned char real_mode_blob_end[];
+extern const unsigned char real_mode_blob_end[];
extern unsigned long initial_code;
extern unsigned long initial_stack;
@@ -67,8 +67,8 @@ extern unsigned long initial_vc_handler;
extern u32 *trampoline_lock;
-extern unsigned char real_mode_blob[];
-extern unsigned char real_mode_relocs[];
+extern const unsigned char real_mode_blob[];
+extern const u32 real_mode_relocs[];
#ifdef CONFIG_X86_32
extern unsigned char startup_32_smp[];
diff --git a/arch/x86/realmode/init.c b/arch/x86/realmode/init.c
index 65110b2ee1a1..5430314d549d 100644
--- a/arch/x86/realmode/init.c
+++ b/arch/x86/realmode/init.c
@@ -118,7 +118,7 @@ static void __init setup_real_mode(void)
phys_base = __pa(base);
real_mode_seg = phys_base >> 4;
- rel = (u32 *) real_mode_relocs;
+ rel = real_mode_relocs;
/* 16-bit segment relocations. */
count = *rel++;