Skip to content

Commit

Permalink
ACPI / x86: Cleanup initrd related code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lv Zheng authored and Rafael J. Wysocki committed Apr 18, 2016
1 parent 5ae74f2 commit af06f8b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions arch/x86/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,21 @@ static void __init reserve_initrd(void)

memblock_free(ramdisk_image, ramdisk_end - ramdisk_image);
}

static void __init early_initrd_acpi_init(void)
{
early_acpi_table_init((void *)initrd_start, initrd_end - initrd_start);
}
#else
static void __init early_reserve_initrd(void)
{
}
static void __init reserve_initrd(void)
{
}
static void __init early_initrd_acpi_init(void)
{
}
#endif /* CONFIG_BLK_DEV_INITRD */

static void __init parse_setup_data(void)
Expand Down Expand Up @@ -1138,9 +1146,7 @@ void __init setup_arch(char **cmdline_p)

reserve_initrd();

#if defined(CONFIG_ACPI) && defined(CONFIG_BLK_DEV_INITRD)
early_acpi_table_init((void *)initrd_start, initrd_end - initrd_start);
#endif
early_initrd_acpi_init();

vsmp_init();

Expand Down

0 comments on commit af06f8b

Please sign in to comment.