Skip to content

Commit f7a25cf

Browse files
ytcoodebp3tk0v
authored andcommitted
x86/setup: Make relocated_ramdisk a local variable of relocate_initrd()
After 0b62f6c ("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
1 parent b85ea95 commit f7a25cf

2 files changed

Lines changed: 1 addition & 5 deletions

File tree

arch/x86/include/asm/setup.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
#include <asm/bootparam.h>
3232
#include <asm/x86_init.h>
3333

34-
extern u64 relocated_ramdisk;
35-
3634
/* Interrupt control for vSMPowered x86_64 systems */
3735
#ifdef CONFIG_X86_64
3836
void vsmp_init(void);

arch/x86/kernel/setup.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,6 @@ static void __init reserve_brk(void)
226226
_brk_start = 0;
227227
}
228228

229-
u64 relocated_ramdisk;
230-
231229
#ifdef CONFIG_BLK_DEV_INITRD
232230

233231
static u64 __init get_ramdisk_image(void)
@@ -261,7 +259,7 @@ static void __init relocate_initrd(void)
261259
u64 area_size = PAGE_ALIGN(ramdisk_size);
262260

263261
/* We need to move the initrd down into directly mapped mem */
264-
relocated_ramdisk = memblock_phys_alloc_range(area_size, PAGE_SIZE, 0,
262+
u64 relocated_ramdisk = memblock_phys_alloc_range(area_size, PAGE_SIZE, 0,
265263
PFN_PHYS(max_pfn_mapped));
266264
if (!relocated_ramdisk)
267265
panic("Cannot find place for new RAMDISK of size %lld\n",

0 commit comments

Comments
 (0)