Skip to contentSkip to conversation

ARM: imx: hide unused variable in #ifdef

PATCH Applied Arnd Bergmann 3 participants 3 messages Jan 10, 2017 – Jan 23, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: imx: hide unused variable in #ifdef

A bugfix added a new local variable that is only used inside of an #ifdef section, and unused if CONFIG_PERF_EVENTS is disabled:

arch/arm/mach-imx/mmdc.c:63:25: warning: 'cpuhp_mmdc_state' defined but not used [-Wunused-variable]

This moves the variable down inside that same ifdef.

Fixes a051f220d6b9 ("ARM/imx/mmcd: Fix broken cpu hotplug handling")
---
 arch/arm/mach-imx/mmdc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-imx/mmdc.c +1 -1
index 699157759120..c03bf28d8bbc 100644
@@ -60,7 +60,6 @@
 
 #define to_mmdc_pmu(p) container_of(p, struct mmdc_pmu, pmu)
 
-static enum cpuhp_state cpuhp_mmdc_state;
 static int ddr_type;
 
 struct fsl_mmdc_devtype_data {
@@ -82,6 +81,7 @@ static const struct of_device_id imx_mmdc_dt_ids[] = {
 
 #ifdef CONFIG_PERF_EVENTS
 
+static enum cpuhp_state cpuhp_mmdc_state;
 static DEFINE_IDA(mmdc_ida);
 
 PMU_EVENT_ATTR_STRING(total-cycles, mmdc_pmu_total_cycles, "event=0x00")
Signature · 1 line
2.9.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 16 lines

-----Original Message-----
From: Arnd Bergmann [mailto:arnd at arndb.de]
Sent: Tuesday, January 10, 2017 6:19 AM
To: Shawn Guo <[email protected]>
Cc: Thomas Gleixner <[email protected]>; Arnd Bergmann <[email protected]>; Sascha Hauer <[email protected]>; Fabio Estevam <[email protected]>; Russell King <[email protected]>; Frank Li <[email protected]>; linux-arm-kernel at lists.infradead.org; linux- kernel at vger.kernel.org
Subject: [PATCH] ARM: imx: hide unused variable in #ifdef

A bugfix added a new local variable that is only used inside of an #ifdef section, and unused if CONFIG_PERF_EVENTS is disabled:

Quoted 8 lines

arch/arm/mach-imx/mmdc.c:63:25: warning: 'cpuhp_mmdc_state' defined but not used [-Wunused-variable]

This moves the variable down inside that same ifdef.

Fixes a051f220d6b9 ("ARM/imx/mmcd: Fix broken cpu hotplug handling")

---

Quoted 25 lines
 arch/arm/mach-imx/mmdc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-imx/mmdc.c +1 -1
index 699157759120..c03bf28d8bbc 100644
@@ -60,7 +60,6 @@
 
 #define to_mmdc_pmu(p) container_of(p, struct mmdc_pmu, pmu)
 
-static enum cpuhp_state cpuhp_mmdc_state;  static int ddr_type;
 
 struct fsl_mmdc_devtype_data {
@@ -82,6 +81,7 @@ static const struct of_device_id imx_mmdc_dt_ids[] = {
 
 #ifdef CONFIG_PERF_EVENTS
 
+static enum cpuhp_state cpuhp_mmdc_state;
 static DEFINE_IDA(mmdc_ida);
 
 PMU_EVENT_ATTR_STRING(total-cycles, mmdc_pmu_total_cycles,

"event=0x00")
--
2.9.0

Applied
#2 lore raw
In reply to Arnd Bergmann
Quoted 9 lines · Arnd Bergmann

A bugfix added a new local variable that is only used inside of an #ifdef section, and unused if CONFIG_PERF_EVENTS is disabled:

arch/arm/mach-imx/mmdc.c:63:25: warning: 'cpuhp_mmdc_state' defined but not used [-Wunused-variable]

This moves the variable down inside that same ifdef.

Fixes a051f220d6b9 ("ARM/imx/mmcd: Fix broken cpu hotplug handling")

Applied, thanks.