Re: [patch-v2.6.33-rc2+ 10/12] arm: omap: gpio: kill compile warning in gpio.c

2010-01-05 Thread Tony Lindgren
* Felipe Balbi  [091229 14:59]:
> when building linux-omap for omap1510, there will
> be a compile warning about the unused flags variable
> which is only used on 16xx and onwards.
> 
> Signed-off-by: Felipe Balbi 
> ---
>  arch/arm/plat-omap/gpio.c |3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
> index 0484681..8c34b81 100644
> --- a/arch/arm/plat-omap/gpio.c
> +++ b/arch/arm/plat-omap/gpio.c
> @@ -1072,7 +1072,10 @@ static inline void _set_gpio_irqenable(struct 
> gpio_bank *bank, int gpio, int ena
>   */
>  static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable)
>  {
> +#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP24XX) || \
> + defined(CONFIG_ARCH_OMAP34XX) || defined(CONFIG_ARCH_OMAP4)
>   unsigned long flags;
> +#endif
>  

Let's not add more ifdeffery to gpio.c.. How about
let's use uninitialized_var() instead? See the patch
below.

Regards,

Tony

>From 62fc4a4ec588956979ef611da8753d8d1c02de8e Mon Sep 17 00:00:00 2001
From: Tony Lindgren 
Date: Tue, 5 Jan 2010 12:17:06 -0800
Subject: [PATCH] omap: Remove uninitialized warning for gpio.c

Flags is not used on 15xx.

Signed-off-by: Tony Lindgren 

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 0484681..792be9f 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -1072,7 +1072,7 @@ static inline void _set_gpio_irqenable(struct gpio_bank *bank, int gpio, int ena
  */
 static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable)
 {
-	unsigned long flags;
+	unsigned long uninitialized_var(flags);
 
 	switch (bank->method) {
 #ifdef CONFIG_ARCH_OMAP16XX


[patch-v2.6.33-rc2+ 10/12] arm: omap: gpio: kill compile warning in gpio.c

2009-12-29 Thread Felipe Balbi
when building linux-omap for omap1510, there will
be a compile warning about the unused flags variable
which is only used on 16xx and onwards.

Signed-off-by: Felipe Balbi 
---
 arch/arm/plat-omap/gpio.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 0484681..8c34b81 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -1072,7 +1072,10 @@ static inline void _set_gpio_irqenable(struct gpio_bank 
*bank, int gpio, int ena
  */
 static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable)
 {
+#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP24XX) || \
+   defined(CONFIG_ARCH_OMAP34XX) || defined(CONFIG_ARCH_OMAP4)
unsigned long flags;
+#endif
 
switch (bank->method) {
 #ifdef CONFIG_ARCH_OMAP16XX
-- 
1.6.6.35.g1d85d

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html