]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ARM: at91: unused variable in at91_pm_verify_clocks
authorArnd Bergmann <arnd@arndb.de>
Mon, 30 Apr 2012 13:00:32 +0000 (13:00 +0000)
committerArnd Bergmann <arnd@arndb.de>
Thu, 4 Oct 2012 14:59:51 +0000 (16:59 +0200)
The code using the variable 'i' in this function is conditional which
results in a harmless compiler warning. Using the IS_ENABLED macro
instead of #ifdef makes the code look nicer and gets rid of the
warning.

Without this patch, building at91sam9263_defconfig results in:

/home/arnd/linux-arm/arch/arm/mach-at91/pm.c: In function 'at91_pm_verify_clocks':
/home/arnd/linux-arm/arch/arm/mach-at91/pm.c:137:6: warning: unused variable 'i' [-Wunused-variable]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
arch/arm/mach-at91/pm.c

index 2c2d86505a541fe1964f3f717d7e81c04f9e6a30..5315f05896e9e9b59d71aa0a2f95d8a4989c0e91 100644 (file)
@@ -153,7 +153,9 @@ static int at91_pm_verify_clocks(void)
                }
        }
 
-#ifdef CONFIG_AT91_PROGRAMMABLE_CLOCKS
+       if (!IS_ENABLED(CONFIG_AT91_PROGRAMMABLE_CLOCKS))
+               return 1;
+
        /* PCK0..PCK3 must be disabled, or configured to use clk32k */
        for (i = 0; i < 4; i++) {
                u32 css;
@@ -167,7 +169,6 @@ static int at91_pm_verify_clocks(void)
                        return 0;
                }
        }
-#endif
 
        return 1;
 }