linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mips: loongson64: fix reset.c build errors when SMP=n
@ 2021-04-30 20:50 Randy Dunlap
  0 siblings, 0 replies; only message in thread
From: Randy Dunlap @ 2021-04-30 20:50 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, kernel test robot, Huacai Chen,
	Thomas Bogendoerfer, Jinyang He

The variable 'secondary_kexec_args' is only declared when
CONFIG_SMP=y. When CONFIG_SMP is not set, referencing the variable
causes syntax errors, so guard the references with #ifdef CONFIG_SMP.

../arch/mips/loongson64/reset.c: In function 'loongson_kexec_shutdown':
../arch/mips/loongson64/reset.c:133:2: error: 'secondary_kexec_args' undeclared (first use in this function)
  133 |  secondary_kexec_args[0] = TO_UNCAC(0x3ff01000);
      |  ^~~~~~~~~~~~~~~~~~~~
../arch/mips/loongson64/reset.c: In function 'loongson_crash_shutdown':
../arch/mips/loongson64/reset.c:144:2: error: 'secondary_kexec_args' undeclared (first use in this function)
  144 |  secondary_kexec_args[0] = TO_UNCAC(0x3ff01000);
      |  ^~~~~~~~~~~~~~~~~~~~

Fixes: 6ce48897ce47 ("MIPS: Loongson64: Add kexec/kdump support")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Cc: Huacai Chen <chenhc@lemote.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Jinyang He <hejinyang@loongson.cn>
---
 arch/mips/loongson64/reset.c |    4 ++++
 1 file changed, 4 insertions(+)

--- linux-next-20210430.orig/arch/mips/loongson64/reset.c
+++ linux-next-20210430/arch/mips/loongson64/reset.c
@@ -130,7 +130,9 @@ static void loongson_kexec_shutdown(void
 	kexec_args[0] = kexec_argc;
 	kexec_args[1] = fw_arg1;
 	kexec_args[2] = fw_arg2;
+#ifdef CONFIG_SMP
 	secondary_kexec_args[0] = TO_UNCAC(0x3ff01000);
+#endif
 	memcpy((void *)fw_arg1, kexec_argv, KEXEC_ARGV_SIZE);
 	memcpy((void *)fw_arg2, kexec_envp, KEXEC_ENVP_SIZE);
 }
@@ -141,7 +143,9 @@ static void loongson_crash_shutdown(stru
 	kexec_args[0] = kdump_argc;
 	kexec_args[1] = fw_arg1;
 	kexec_args[2] = fw_arg2;
+#ifdef CONFIG_SMP
 	secondary_kexec_args[0] = TO_UNCAC(0x3ff01000);
+#endif
 	memcpy((void *)fw_arg1, kdump_argv, KEXEC_ARGV_SIZE);
 	memcpy((void *)fw_arg2, kexec_envp, KEXEC_ENVP_SIZE);
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-30 20:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-30 20:50 [PATCH] mips: loongson64: fix reset.c build errors when SMP=n Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).