ARM: imx: hide unused variable in #ifdef
authorArnd Bergmann <arnd@arndb.de>
Tue, 10 Jan 2017 12:19:05 +0000 (13:19 +0100)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:10:49 +0000 (15:10 -0500)
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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
arch/arm/mach-imx/mmdc.c

index 0e5efb5..5832d7c 100644 (file)
@@ -62,7 +62,6 @@
 
 #define to_mmdc_pmu(p) container_of(p, struct mmdc_pmu, pmu)
 
-static enum cpuhp_state cpuhp_mmdc_state;
 static int ddr_type;
 static int lpddr2_2ch_mode;
 
@@ -86,6 +85,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")