Skip to contentSkip to conversation

ARM: trusted_foundations: fix compile error on non-SMP

PATCH RESEND In review Alexandre Courbot 4 participants 5 messages May 23, 2014 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 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)

---
Hi Stephen,

This patch has been originally submitted through Russell's patch tracker, where it has stayed untouched for ~3 weeks now. Considering that this fixes a compilation error and should thus be made available quickly, and that Tegra is the only user of Trusted Foundations, would you agree to take it into your tree?

 arch/arm/include/asm/trusted_foundations.h | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/include/asm/trusted_foundations.h +2 -0
index b5f7705..624e1d4 100644
@@ -54,7 +54,9 @@ static inline void register_trusted_foundations(
 	 */
 	pr_err("No support for Trusted Foundations, continuing in degraded mode.\n");
 	pr_err("Secondary processors as well as CPU PM will be disabled.\n");
+#if IS_ENABLED(CONFIG_SMP)
 	setup_max_cpus = 0;
+#endif
 	cpu_idle_poll_ctrl(true);
 }
 
Signature · 1 line
1.9.2
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Alexandre Courbot

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)

I spoke to Olof and IRC, and he said arm-soc would be OK taking this patch, since they applied the original code this fixes. IIUC, they'll pick this up directly.

#3 lore raw
In reply to Alexandre Courbot

Hello.

Quoted 26 lines · Alexandre Courbot

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)

---
Hi Stephen,

This patch has been originally submitted through Russell's patch tracker, where it has stayed untouched for ~3 weeks now. Considering that this fixes a compilation error and should thus be made available quickly, and that Tegra is the only user of Trusted Foundations, would you agree to take it into your tree?

  arch/arm/include/asm/trusted_foundations.h | 2 ++
  1 file changed, 2 insertions(+)
arch/arm/include/asm/trusted_foundations.h +0 -0
index b5f7705..624e1d4 100644

arch/arm/include/asm/trusted_foundations.h static inline void register_trusted_foundations( · line 57

Quoted 4 lines
arch/arm/include/asm/trusted_foundations.h +1 -0
@@ -54,7 +54,9 @@ static inline void register_trusted_foundations(
  	 */
  	pr_err("No support for Trusted Foundations, continuing in degraded mode.\n");
  	pr_err("Secondary processors as well as CPU PM will be disabled.\n");
+#if IS_ENABLED(CONFIG_SMP)

if (IS_ENABLED(CONFIG_SMP))

arch/arm/include/asm/trusted_foundations.h static inline void register_trusted_foundations( · line 59

Quoted 2 lines
arch/arm/include/asm/trusted_foundations.h +1 -0
  	setup_max_cpus = 0;
+#endif

WBR, Sergei

#4 lore raw
Quoted 7 lines · Sergei Shtylyov
Quoted 1 line

+#if IS_ENABLED(CONFIG_SMP)

if (IS_ENABLED(CONFIG_SMP))

Quoted 2 lines
      setup_max_cpus = 0;

+#endif

That wouldn't help to fix the build error when setup_max_cpus is not declared.

Arnd

#2 lore raw
In reply to Stephen Warren
Quoted 8 lines · Stephen Warren
Quoted 7 lines · Alexandre Courbot

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)

Quoted 9 lines
Quoted 2 lines

I spoke to Olof and IRC, and he said arm-soc would be OK taking this patch, since they applied the original code this fixes. IIUC, they'll pick this up directly.

Pulled into the fixes branch now, thanks!

Arnd