Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7781544e authored by Naveen N. Rao's avatar Naveen N. Rao Committed by Ingo Molnar
Browse files

x86/mce, acpi/apei: Only disable banks listed in HEST if mce is configured



Randconfig testing found this build error:

 >> hest.c(.init.text+0x6004): undefined reference to 'mce_disable_bank'

Fix by wrapping body of hest_parse_cmc() inside #ifdef
CONFIG_X86_MCE

Reported-by: default avatar"Wu, Fengguang" <fengguang.wu@intel.com>
Signed-off-by: default avatarNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
Acked-by: default avatarBorislav Petkov <bp@alien8.de>
Link: http://lkml.kernel.org/r/0129220@agluck-desk.sc.intel.com


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 0237d7f3
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -128,6 +128,7 @@ EXPORT_SYMBOL_GPL(apei_hest_parse);
 */
 */
static int __init hest_parse_cmc(struct acpi_hest_header *hest_hdr, void *data)
static int __init hest_parse_cmc(struct acpi_hest_header *hest_hdr, void *data)
{
{
#ifdef CONFIG_X86_MCE
	int i;
	int i;
	struct acpi_hest_ia_corrected *cmc;
	struct acpi_hest_ia_corrected *cmc;
	struct acpi_hest_ia_error_bank *mc_bank;
	struct acpi_hest_ia_error_bank *mc_bank;
@@ -152,7 +153,7 @@ static int __init hest_parse_cmc(struct acpi_hest_header *hest_hdr, void *data)
	mc_bank = (struct acpi_hest_ia_error_bank *)(cmc + 1);
	mc_bank = (struct acpi_hest_ia_error_bank *)(cmc + 1);
	for (i = 0; i < cmc->num_hardware_banks; i++, mc_bank++)
	for (i = 0; i < cmc->num_hardware_banks; i++, mc_bank++)
		mce_disable_bank(mc_bank->bank_number);
		mce_disable_bank(mc_bank->bank_number);

#endif
	return 1;
	return 1;
}
}