x86/realmode: Use const and u32 for embedded real-mode data
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.
Signed-off-by Thorsten Blum <[email protected]>
--- 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
@@ -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
@@ -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++;
Quoted 9 lines · Thorsten Blum
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 <[email protected]>
Reviewed-by H. Peter Anvin (RosaicLabs) <[email protected]>