Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Lv Zheng and committed by
Rafael J. Wysocki
af06f8b7 5ae74f2c

+9 -3
+9 -3
arch/x86/kernel/setup.c
··· 398 398 399 399 memblock_free(ramdisk_image, ramdisk_end - ramdisk_image); 400 400 } 401 + 402 + static void __init early_initrd_acpi_init(void) 403 + { 404 + early_acpi_table_init((void *)initrd_start, initrd_end - initrd_start); 405 + } 401 406 #else 402 407 static void __init early_reserve_initrd(void) 403 408 { 404 409 } 405 410 static void __init reserve_initrd(void) 411 + { 412 + } 413 + static void __init early_initrd_acpi_init(void) 406 414 { 407 415 } 408 416 #endif /* CONFIG_BLK_DEV_INITRD */ ··· 1146 1138 1147 1139 reserve_initrd(); 1148 1140 1149 - #if defined(CONFIG_ACPI) && defined(CONFIG_BLK_DEV_INITRD) 1150 - early_acpi_table_init((void *)initrd_start, initrd_end - initrd_start); 1151 - #endif 1141 + early_initrd_acpi_init(); 1152 1142 1153 1143 vsmp_init(); 1154 1144