[tip: x86/microcode] x86/microcode: Add microcode_loader_disabled() storage class for the !CONFIG_MICROCODE case

From: tip-bot2 for Ingo Molnar
Date: Mon May 05 2025 - 03:28:09 EST


The following commit has been merged into the x86/microcode branch of tip:

Commit-ID: 59e820c6de60e81757211fbb846129485e337ee0
Gitweb: https://git.kernel.org/tip/59e820c6de60e81757211fbb846129485e337ee0
Author: Ingo Molnar <mingo@xxxxxxxxxx>
AuthorDate: Mon, 05 May 2025 07:15:04 +02:00
Committer: Ingo Molnar <mingo@xxxxxxxxxx>
CommitterDate: Mon, 05 May 2025 09:17:02 +02:00

x86/microcode: Add microcode_loader_disabled() storage class for the !CONFIG_MICROCODE case

Fix this build bug:

./arch/x86/include/asm/microcode.h:27:13: warning: no previous prototype for ‘microcode_loader_disabled’ [-Wmissing-prototypes]

by adding the 'static' storage class to the !CONFIG_MICROCODE
prototype.

Also, while at it, add all the other storage classes as well for this
block of prototypes, 'extern' and 'static', respectively.

( Omitting 'extern' just because it's technically not needed
is a bad habit for header prototypes and leads to bugs like
this one. )

Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: "Borislav Petkov (AMD)" <bp@xxxxxxxxx>
Link: https://lore.kernel.org/r/aBhJVJDTlw2Y8owu@xxxxxxxxx
---
arch/x86/include/asm/microcode.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microcode.h
index d53148f..b68fc9d 100644
--- a/arch/x86/include/asm/microcode.h
+++ b/arch/x86/include/asm/microcode.h
@@ -14,15 +14,15 @@ struct ucode_cpu_info {
};

#ifdef CONFIG_MICROCODE
-void load_ucode_bsp(void);
-void load_ucode_ap(void);
-void microcode_bsp_resume(void);
-bool __init microcode_loader_disabled(void);
+extern void load_ucode_bsp(void);
+extern void load_ucode_ap(void);
+extern void microcode_bsp_resume(void);
+extern bool __init microcode_loader_disabled(void);
#else
static inline void load_ucode_bsp(void) { }
static inline void load_ucode_ap(void) { }
static inline void microcode_bsp_resume(void) { }
-bool __init microcode_loader_disabled(void) { return false; }
+static inline bool microcode_loader_disabled(void) { return false; }
#endif

extern unsigned long initrd_start_early;