Skip to content

Commit af06f8b

Browse files
Lv Zhengrafaeljw
authored andcommitted
ACPI / x86: Cleanup initrd related code
In arch/x86/kernel/setup.c, the #ifdef kept for CONFIG_ACPI actually is related to the accessibility of initrd_start/initrd_end, so the stub should be provided from this source file and should only be dependent on CONFIG_BLK_DEV_INITRD. Note that when ACPI=n and BLK_DEV_INITRD=y, early_initrd_acpi_init() is still a stub because of the stub prepared for early_acpi_table_init(). Signed-off-by: Lv Zheng <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 5ae74f2 commit af06f8b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

arch/x86/kernel/setup.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,13 +398,21 @@ static void __init reserve_initrd(void)
398398

399399
memblock_free(ramdisk_image, ramdisk_end - ramdisk_image);
400400
}
401+
402+
static void __init early_initrd_acpi_init(void)
403+
{
404+
early_acpi_table_init((void *)initrd_start, initrd_end - initrd_start);
405+
}
401406
#else
402407
static void __init early_reserve_initrd(void)
403408
{
404409
}
405410
static void __init reserve_initrd(void)
406411
{
407412
}
413+
static void __init early_initrd_acpi_init(void)
414+
{
415+
}
408416
#endif /* CONFIG_BLK_DEV_INITRD */
409417

410418
static void __init parse_setup_data(void)
@@ -1138,9 +1146,7 @@ void __init setup_arch(char **cmdline_p)
11381146

11391147
reserve_initrd();
11401148

1141-
#if defined(CONFIG_ACPI) && defined(CONFIG_BLK_DEV_INITRD)
1142-
early_acpi_table_init((void *)initrd_start, initrd_end - initrd_start);
1143-
#endif
1149+
early_initrd_acpi_init();
11441150

11451151
vsmp_init();
11461152

0 commit comments

Comments
 (0)