Skip to contentSkip to conversation

powerpc/pmac/smp: avoid unused-variable warnings

PATCH Applied Ilie Halip 4 participants 4 messages Sep 20, 2019 – Mar 17, 2020

Subsystems (2)
lore
Share & tools
lore

Ilie Halip

author
#0 lore raw

PATCH 1/1 powerpc/pmac/smp: avoid unused-variable warnings

When building with ppc64_defconfig, the compiler reports that these 2 variables are not used:
warning: unused variable 'core99_l2_cache' [-Wunused-variable]
warning: unused variable 'core99_l3_cache' [-Wunused-variable]

They are only used when CONFIG_PPC64 is not defined. Move them into a section which does the same macro check.

---
 arch/powerpc/platforms/powermac/smp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/powerpc/platforms/powermac/smp.c +4 -4
index f95fbdee6efe..e44c606f119e 100644
@@ -648,6 +648,10 @@ static void smp_core99_pfunc_tb_freeze(int freeze)
 
 static unsigned int core99_tb_gpio;	/* Timebase freeze GPIO */
 
+/* L2 and L3 cache settings to pass from CPU0 to CPU1 on G4 cpus */
+volatile static long int core99_l2_cache;
+volatile static long int core99_l3_cache;
+
 static void smp_core99_gpio_tb_freeze(int freeze)
 {
 	if (freeze)
@@ -660,10 +664,6 @@ static void smp_core99_gpio_tb_freeze(int freeze)
 
 #endif /* !CONFIG_PPC64 */
 
-/* L2 and L3 cache settings to pass from CPU0 to CPU1 on G4 cpus */
-volatile static long int core99_l2_cache;
-volatile static long int core99_l3_cache;
-
 static void core99_init_caches(int cpu)
 {
 #ifndef CONFIG_PPC64
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Ilie Halip

When building with ppc64_defconfig, the compiler reports that these 2 variables are not used:
warning: unused variable 'core99_l2_cache' [-Wunused-variable]
warning: unused variable 'core99_l3_cache' [-Wunused-variable]

They are only used when CONFIG_PPC64 is not defined. Move them into a section which does the same macro check.

Hi Ilie, thanks for the patch. LGTM (Please include link tags if your link addresses a bug in our bug tracker; it helps us track where/when patches land, in case they need to be backported).

Quoted 37 lines
---
 arch/powerpc/platforms/powermac/smp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/powerpc/platforms/powermac/smp.c +4 -5
index f95fbdee6efe..e44c606f119e 100644
@@ -648,6 +648,10 @@ static void smp_core99_pfunc_tb_freeze(int freeze)
 
 static unsigned int core99_tb_gpio;    /* Timebase freeze GPIO */
 
+/* L2 and L3 cache settings to pass from CPU0 to CPU1 on G4 cpus */
+volatile static long int core99_l2_cache;
+volatile static long int core99_l3_cache;
+
 static void smp_core99_gpio_tb_freeze(int freeze)
 {
        if (freeze)
@@ -660,10 +664,6 @@ static void smp_core99_gpio_tb_freeze(int freeze)
 
 #endif /* !CONFIG_PPC64 */
 
-/* L2 and L3 cache settings to pass from CPU0 to CPU1 on G4 cpus */
-volatile static long int core99_l2_cache;
-volatile static long int core99_l3_cache;
-
 static void core99_init_caches(int cpu)
 {
 #ifndef CONFIG_PPC64
--

2.17.1

--
You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20190920153951.25762-1-ilie.halip%40gmail.com.

Signature · 2 lines
Thanks,
~Nick Desaulniers
Reviewed-by on v1 1/1
#2 lore raw
In reply to Ilie Halip
Quoted 10 lines · Ilie Halip

When building with ppc64_defconfig, the compiler reports that these 2 variables are not used:
warning: unused variable 'core99_l2_cache' [-Wunused-variable]
warning: unused variable 'core99_l3_cache' [-Wunused-variable]

They are only used when CONFIG_PPC64 is not defined. Move them into a section which does the same macro check.

#3 lore raw
In reply to Ilie Halip
Quoted 10 lines · Ilie Halip

When building with ppc64_defconfig, the compiler reports that these 2 variables are not used:
warning: unused variable 'core99_l2_cache' [-Wunused-variable]
warning: unused variable 'core99_l3_cache' [-Wunused-variable]

They are only used when CONFIG_PPC64 is not defined. Move them into a section which does the same macro check.

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/9451c79bc39e610882bdd12370f01af5004a3c4f

cheers