Skip to content

Commit

Permalink
mmc: sdhci: fix "pwr may be used uninitialized" warning
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Giuseppe Cavallaro authored and Chris Ball committed Oct 23, 2010
1 parent be8ae09 commit 8364248
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/mmc/host/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1050,11 +1050,9 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock)

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;
Expand Down

0 comments on commit 8364248

Please sign in to comment.