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

ARM: trusted_foundations: fix compile error on non-SMP

The setup_max_cpus variable is only defined if CONFIG_SMP is set. Add
a preprocessor condition to avoid the following compilation error if
CONFIG_SMP is not set:

arch/arm/include/asm/trusted_foundations.h: In function 'register_trusted_foundations':
arch/arm/include/asm/trusted_foundations.h:57:2: error: 'setup_max_cpus' undeclared (first use in this function)

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

authored by

Alexandre Courbot and committed by
Arnd Bergmann
3aae97c8 756abc8d

+2
+2
arch/arm/include/asm/trusted_foundations.h
··· 54 54 */ 55 55 pr_err("No support for Trusted Foundations, continuing in degraded mode.\n"); 56 56 pr_err("Secondary processors as well as CPU PM will be disabled.\n"); 57 + #if IS_ENABLED(CONFIG_SMP) 57 58 setup_max_cpus = 0; 59 + #endif 58 60 cpu_idle_poll_ctrl(true); 59 61 } 60 62