x86/setup: Make relocated_ramdisk a local variable of relocate_initrd()
authorYuntao Wang <ytcoode@gmail.com>
Mon, 13 Nov 2023 03:40:26 +0000 (11:40 +0800)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 13 Nov 2023 08:09:37 +0000 (09:09 +0100)
After

  0b62f6cb0773 ("x86/microcode/32: Move early loading after paging enable"),

the global variable relocated_ramdisk is no longer used anywhere except
for the relocate_initrd() function. Make it a local variable of that
function.

Signed-off-by: Yuntao Wang <ytcoode@gmail.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Baoquan He <bhe@redhat.com>
Link: https://lore.kernel.org/r/20231113034026.130679-1-ytcoode@gmail.com
arch/x86/include/asm/setup.h
arch/x86/kernel/setup.c

index bf483fcb4e5744c28a259e593974df7ead912683..5c83729c8e71ff5a287095211829cf197365a728 100644 (file)
@@ -31,8 +31,6 @@
 #include <asm/bootparam.h>
 #include <asm/x86_init.h>
 
-extern u64 relocated_ramdisk;
-
 /* Interrupt control for vSMPowered x86_64 systems */
 #ifdef CONFIG_X86_64
 void vsmp_init(void);
index 1526747bedf2fd3d69658ad0d084e5aa49a95f44..ec2c21a1844e3e8e128ead89213588ec6828bca9 100644 (file)
@@ -226,8 +226,6 @@ static void __init reserve_brk(void)
        _brk_start = 0;
 }
 
-u64 relocated_ramdisk;
-
 #ifdef CONFIG_BLK_DEV_INITRD
 
 static u64 __init get_ramdisk_image(void)
@@ -261,7 +259,7 @@ static void __init relocate_initrd(void)
        u64 area_size     = PAGE_ALIGN(ramdisk_size);
 
        /* We need to move the initrd down into directly mapped mem */
-       relocated_ramdisk = memblock_phys_alloc_range(area_size, PAGE_SIZE, 0,
+       u64 relocated_ramdisk = memblock_phys_alloc_range(area_size, PAGE_SIZE, 0,
                                                      PFN_PHYS(max_pfn_mapped));
        if (!relocated_ramdisk)
                panic("Cannot find place for new RAMDISK of size %lld\n",