]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
mmc: sdhci: fix "pwr may be used uninitialized" warning
authorGiuseppe Cavallaro <peppe.cavallaro@st.com>
Tue, 28 Sep 2010 08:41:28 +0000 (10:41 +0200)
committerChris Ball <cjb@laptop.org>
Sat, 23 Oct 2010 13:11:17 +0000 (21:11 +0800)
This patch fixes a warning when compiling the sdhci driver:
  pwr may be used uninitialized in sdhci_set_power

Tested with the following compiler versions: 4.2.4 and 4.4.4

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/sdhci.c

index 96c7f6010d0d83c0a438ad04b7ee3a1c04a8a92b..d3f924bcfffd178bee79529d4e0bb51b6ae2a891 100644 (file)
@@ -1050,11 +1050,9 @@ out:
 
 static void sdhci_set_power(struct sdhci_host *host, unsigned short power)
 {
-       u8 pwr;
+       u8 pwr = 0;
 
-       if (power == (unsigned short)-1)
-               pwr = 0;
-       else {
+       if (power != (unsigned short)-1) {
                switch (1 << power) {
                case MMC_VDD_165_195:
                        pwr = SDHCI_POWER_180;