Skip to contentSkip to conversation

x86/realmode: Use const and u32 for embedded real-mode data

PATCH In review Thorsten Blum 2 participants 2 messages Nov 5 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/realmode: Use const and u32 for embedded real-mode data

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.

---
 arch/x86/include/asm/realmode.h | 6 +++---
 arch/x86/realmode/init.c        | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/x86/include/asm/realmode.h +3 -3
index e406a1e92c63..e48259f2e503 100644
@@ -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[];
arch/x86/realmode/init.c +1 -1
index 65110b2ee1a1..5430314d549d 100644
@@ -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++;