Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Loongson64: Fix build error 'secondary_kexec_args' undeclared under !SMP

On the Loongson64 platform, if CONFIG_SMP is not set, the following build
error will occur:
arch/mips/loongson64/reset.c:133:2: error:'secondary_kexec_args' undeclared

Because the definition and declaration of secondary_kexec_args are in the
CONFIG_SMP, the secondary_kexec_args variable should be used in CONFIG_SMP.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Youling Tang <tangyouling@loongson.cn>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

authored by

Youling Tang and committed by
Thomas Bogendoerfer
6a73022e cf5b6a94

+4 -1
+4 -1
arch/mips/loongson64/reset.c
··· 126 126 for_each_possible_cpu(cpu) 127 127 if (!cpu_online(cpu)) 128 128 cpu_device_up(get_cpu_device(cpu)); 129 + 130 + secondary_kexec_args[0] = TO_UNCAC(0x3ff01000); 129 131 #endif 130 132 kexec_args[0] = kexec_argc; 131 133 kexec_args[1] = fw_arg1; 132 134 kexec_args[2] = fw_arg2; 133 - secondary_kexec_args[0] = TO_UNCAC(0x3ff01000); 134 135 memcpy((void *)fw_arg1, kexec_argv, KEXEC_ARGV_SIZE); 135 136 memcpy((void *)fw_arg2, kexec_envp, KEXEC_ENVP_SIZE); 136 137 } ··· 142 141 kexec_args[0] = kdump_argc; 143 142 kexec_args[1] = fw_arg1; 144 143 kexec_args[2] = fw_arg2; 144 + #ifdef CONFIG_SMP 145 145 secondary_kexec_args[0] = TO_UNCAC(0x3ff01000); 146 + #endif 146 147 memcpy((void *)fw_arg1, kdump_argv, KEXEC_ARGV_SIZE); 147 148 memcpy((void *)fw_arg2, kexec_envp, KEXEC_ENVP_SIZE); 148 149 }