Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1340638 > unrolled thread

[PATCH 2/3] ARM: omap1: avoid unused variable warning

Started byArnd Bergmann <arnd@arndb.de>
First post2016-02-23 15:00 +0100
Last post2016-02-24 00:50 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/3] ARM: omap1: avoid unused variable warning Arnd Bergmann <arnd@arndb.de> - 2016-02-23 15:00 +0100
    Re: [PATCH 2/3] ARM: omap1: avoid unused variable warning Tony Lindgren <tony@atomide.com> - 2016-02-23 17:20 +0100
    Re: [PATCH 2/3] ARM: omap1: avoid unused variable warning Aaro Koskinen <aaro.koskinen@iki.fi> - 2016-02-24 00:50 +0100

#1340638 — [PATCH 2/3] ARM: omap1: avoid unused variable warning

FromArnd Bergmann <arnd@arndb.de>
Date2016-02-23 15:00 +0100
Subject[PATCH 2/3] ARM: omap1: avoid unused variable warning
Message-ID<r5lFo-6dV-23@gated-at.bofh.it>
The osk_mistral_init() contains code that is only compiled when
CONFIG_PM is set, but it uses a variable that is declared outside
of the #ifdef:

arch/arm/mach-omap1/board-osk.c: In function 'osk_mistral_init':
arch/arm/mach-omap1/board-osk.c:513:7: warning: unused variable 'ret' [-Wunused-variable]

This puts the variable in the same #ifdef to avoid the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-omap1/board-osk.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index 209aecb0df68..fcc5c0650429 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -510,7 +510,9 @@ static void __init osk_mistral_init(void)
 	 */
 	omap_cfg_reg(N15_1610_MPUIO2);
 	if (gpio_request(OMAP_MPUIO(2), "wakeup") == 0) {
+#ifdef	CONFIG_PM
 		int ret = 0;
+#endif
 		int irq = gpio_to_irq(OMAP_MPUIO(2));
 
 		gpio_direction_input(OMAP_MPUIO(2));
-- 
2.7.0

[toc] | [next] | [standalone]


#1340833

FromTony Lindgren <tony@atomide.com>
Date2016-02-23 17:20 +0100
Message-ID<r5nQT-7QI-43@gated-at.bofh.it>
In reply to#1340638
* Arnd Bergmann <arnd@arndb.de> [160223 05:58]:
> The osk_mistral_init() contains code that is only compiled when
> CONFIG_PM is set, but it uses a variable that is declared outside
> of the #ifdef:
> 
> arch/arm/mach-omap1/board-osk.c: In function 'osk_mistral_init':
> arch/arm/mach-omap1/board-osk.c:513:7: warning: unused variable 'ret' [-Wunused-variable]
> 
> This puts the variable in the same #ifdef to avoid the warning.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/arm/mach-omap1/board-osk.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
> index 209aecb0df68..fcc5c0650429 100644
> --- a/arch/arm/mach-omap1/board-osk.c
> +++ b/arch/arm/mach-omap1/board-osk.c
> @@ -510,7 +510,9 @@ static void __init osk_mistral_init(void)
>  	 */
>  	omap_cfg_reg(N15_1610_MPUIO2);
>  	if (gpio_request(OMAP_MPUIO(2), "wakeup") == 0) {
> +#ifdef	CONFIG_PM
>  		int ret = 0;
> +#endif
>  		int irq = gpio_to_irq(OMAP_MPUIO(2));
>  
>  		gpio_direction_input(OMAP_MPUIO(2));

Let's just remove the #ifdef CONFIG_PM in osk_mistral_init()
instead. That's for the wake-up button and I'm not aware
of any other use cases for that button.

Regards,

Tony

[toc] | [prev] | [next] | [standalone]


#1341186

FromAaro Koskinen <aaro.koskinen@iki.fi>
Date2016-02-24 00:50 +0100
Message-ID<r5uSm-4mi-17@gated-at.bofh.it>
In reply to#1340638
On Tue, Feb 23, 2016 at 02:57:52PM +0100, Arnd Bergmann wrote:
> The osk_mistral_init() contains code that is only compiled when
> CONFIG_PM is set, but it uses a variable that is declared outside
> of the #ifdef:
> 
> arch/arm/mach-omap1/board-osk.c: In function 'osk_mistral_init':
> arch/arm/mach-omap1/board-osk.c:513:7: warning: unused variable 'ret' [-Wunused-variable]
> 
> This puts the variable in the same #ifdef to avoid the warning.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Aaro Koskinen <aaro.koskinen@iki.fi>

A.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web