bec7366
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
bec7366
From: Don Zickus <dzickus@redhat.com>
bec7366
Date: Thu, 14 May 2020 10:30:51 -0400
bec7366
Subject: [PATCH] x86: Fix compile issues with rh_check_supported()
bec7366
bec7366
Upstream status: RHEL only
bec7366
bec7366
The function rh_check_supported is a RHEL function to limit the
bec7366
platforms RHEL does not want to support.
bec7366
bec7366
To avoid imposing this requirement on Fedora, the function was
bec7366
wrapped with CONFIG_RHEL_DIFFERENCES so Fedora can disable this.
bec7366
bec7366
However, this has a few compile warnings that need to be cleaned up
bec7366
when disabled.
bec7366
bec7366
Move CONFIG_RHEL_DIFFERENCES to include the functions themselves
bec7366
instead of the call.  As the unused functions created warnings.
bec7366
bec7366
V2: modified stub definition
bec7366
bec7366
Signed-off-by: Don Zickus <dzickus@redhat.com>
bec7366
---
bec7366
 arch/x86/kernel/setup.c | 6 ++++--
bec7366
 1 file changed, 4 insertions(+), 2 deletions(-)
bec7366
bec7366
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
fa1dee0
index e677bb144835..6d31895c8e92 100644
bec7366
--- a/arch/x86/kernel/setup.c
bec7366
+++ b/arch/x86/kernel/setup.c
fa1dee0
@@ -756,6 +756,7 @@ static void __init trim_low_memory_range(void)
bec7366
 	memblock_reserve(0, ALIGN(reserve_low, PAGE_SIZE));
bec7366
 }
bec7366
bec7366
+#ifdef CONFIG_RHEL_DIFFERENCES
bec7366
 static bool valid_amd_processor(__u8 family, const char *model_id)
bec7366
 {
bec7366
 	bool valid;
fa1dee0
@@ -880,6 +881,9 @@ static void rh_check_supported(void)
bec7366
 	if (acpi_disabled && !guest)
bec7366
 		pr_crit("ACPI has been disabled or is not available on this hardware.  This may result in a single cpu boot, incorrect PCI IRQ routing, or boot failure.\n");
bec7366
 }
bec7366
+#else
bec7366
+#define rh_check_supported()
bec7366
+#endif
bec7366
bec7366
 /*
bec7366
  * Dump out kernel offset information on panic.
fa1dee0
@@ -1372,9 +1376,7 @@ void __init setup_arch(char **cmdline_p)
bec7366
 		efi_apply_memmap_quirks();
bec7366
 #endif
bec7366
bec7366
-#ifdef CONFIG_RHEL_DIFFERENCES
bec7366
 	rh_check_supported();
bec7366
-#endif
bec7366
bec7366
 	unwind_init();
bec7366
 }
bec7366
-- 
bec7366
2.26.2
bec7366