[PATCH] panic: fix unused variable warning when SMP or CRASH_DUMP disabled

Pnina Feder posted 1 patch 1 week, 4 days ago
kernel/panic.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH] panic: fix unused variable warning when SMP or CRASH_DUMP disabled
Posted by Pnina Feder 1 week, 4 days ago
Fix for pending patch:
"panic: add panic_force_cpu= parameter to redirect panic to a specific CPU"

Move panic_force_buf inside the #ifdef block to fix unused variable
warning when CONFIG_SMP or CONFIG_CRASH_DUMP is not enabled.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202601222042.OSZryOnl-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202601230908.0vB3SoHM-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202601231058.Q6hDGfoT-lkp@intel.com/
Signed-off-by: Pnina Feder <pnina.feder@mobileye.com>
---
 kernel/panic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index 970b7dd7b4c5..ee408ca76211 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -76,7 +76,6 @@ EXPORT_SYMBOL_GPL(panic_timeout);
 unsigned long panic_print;
 
 static int panic_force_cpu = -1;
-static char *panic_force_buf;
 
 ATOMIC_NOTIFIER_HEAD(panic_notifier_list);
 
@@ -306,6 +305,8 @@ atomic_t panic_cpu = ATOMIC_INIT(PANIC_CPU_INVALID);
 atomic_t panic_redirect_cpu = ATOMIC_INIT(PANIC_CPU_INVALID);
 
 #if defined(CONFIG_SMP) && defined(CONFIG_CRASH_DUMP)
+static char *panic_force_buf;
+
 static int __init panic_force_cpu_setup(char *str)
 {
 	int cpu;
-- 
2.43.0