* [PATCH] ARM: imx: hide unused variable in #ifdef
@ 2017-01-10 12:19 Arnd Bergmann
2017-01-10 14:53 ` Frank Li
2017-01-23 6:59 ` Shawn Guo
0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2017-01-10 12:19 UTC (permalink / raw)
To: Shawn Guo
Cc: Thomas Gleixner, Arnd Bergmann, Sascha Hauer, Fabio Estevam,
Russell King, Frank Li, linux-arm-kernel, linux-kernel
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>
---
arch/arm/mach-imx/mmdc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c
index 699157759120..c03bf28d8bbc 100644
--- a/arch/arm/mach-imx/mmdc.c
+++ b/arch/arm/mach-imx/mmdc.c
@@ -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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH] ARM: imx: hide unused variable in #ifdef
2017-01-10 12:19 [PATCH] ARM: imx: hide unused variable in #ifdef Arnd Bergmann
@ 2017-01-10 14:53 ` Frank Li
2017-01-23 6:59 ` Shawn Guo
1 sibling, 0 replies; 3+ messages in thread
From: Frank Li @ 2017-01-10 14:53 UTC (permalink / raw)
To: Arnd Bergmann, Shawn Guo
Cc: Thomas Gleixner, Sascha Hauer, Fabio Estevam, Russell King,
linux-arm-kernel, linux-kernel
> -----Original Message-----
> From: Arnd Bergmann [mailto:arnd@arndb.de]
> Sent: Tuesday, January 10, 2017 6:19 AM
> To: Shawn Guo <shawnguo@kernel.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>; Arnd Bergmann
> <arnd@arndb.de>; Sascha Hauer <kernel@pengutronix.de>; Fabio Estevam
> <fabio.estevam@nxp.com>; Russell King <linux@armlinux.org.uk>; Frank Li
> <frank.li@nxp.com>; linux-arm-kernel@lists.infradead.org; linux-
> kernel@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:
>
> 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>
> arch/arm/mach-imx/mmdc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c
> index 699157759120..c03bf28d8bbc 100644
> --- a/arch/arm/mach-imx/mmdc.c
> +++ b/arch/arm/mach-imx/mmdc.c
> @@ -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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ARM: imx: hide unused variable in #ifdef
2017-01-10 12:19 [PATCH] ARM: imx: hide unused variable in #ifdef Arnd Bergmann
2017-01-10 14:53 ` Frank Li
@ 2017-01-23 6:59 ` Shawn Guo
1 sibling, 0 replies; 3+ messages in thread
From: Shawn Guo @ 2017-01-23 6:59 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Thomas Gleixner, Sascha Hauer, Fabio Estevam, Russell King,
Frank Li, linux-arm-kernel, linux-kernel
On Tue, Jan 10, 2017 at 01:19:05PM +0100, Arnd Bergmann wrote:
> 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>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-01-23 6:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-10 12:19 [PATCH] ARM: imx: hide unused variable in #ifdef Arnd Bergmann
2017-01-10 14:53 ` Frank Li
2017-01-23 6:59 ` Shawn Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).