Skip to contentSkip to conversation

drivers/mmc/tegra2_mmc.c: fix GCC 4.6 warning

PATCH New Anatolij Gustschin 3 participants 3 messages Mar 28, 2012 – Mar 30, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/mmc/tegra2_mmc.c: fix GCC 4.6 warning

Fix:
tegra2_mmc.c: In function 'mmc_send_cmd':
tegra2_mmc.c:230:3: warning: 'mask' may be used uninitialized in this function [-Wuninitialized]

---
gcc is wrong here, I think. But I'd like to have a clean build log.

Anatolij

 drivers/mmc/tegra2_mmc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mmc/tegra2_mmc.c +1 -1
index 33cc8fb..fb8a57d 100644
@@ -162,7 +162,7 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
 	struct mmc_host *host = (struct mmc_host *)mmc->priv;
 	int flags, i;
 	int result;
-	unsigned int mask;
+	unsigned int mask = 0;
 	unsigned int retry = 0x100000;
 	debug(" mmc_send_cmd called\n");
 
Signature · 1 line
1.7.7.6
#1 lore raw

PATCH 1/1 drivers/mmc/tegra2_mmc.c: fix GCC 4.6 warning

Anatolij,

Quoted 12 lines

-----Original Message-----
From: Anatolij Gustschin [mailto:agust at denx.de]
Sent: Wednesday, March 28, 2012 6:40 AM
To: u-boot at lists.denx.de
Cc: Doug Anderson; Tom Warren
Subject: [PATCH] drivers/mmc/tegra2_mmc.c: fix GCC 4.6 warning

Fix:
tegra2_mmc.c: In function 'mmc_send_cmd':
tegra2_mmc.c:230:3: warning: 'mask' may be used uninitialized in this function [-Wuninitialized]

Quoted 6 lines

---
gcc is wrong here, I think. But I'd like to have a clean build log.

I agree that gcc is being overly paranoid, but thanks for the fix!

Quoted 21 lines

Anatolij

 drivers/mmc/tegra2_mmc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mmc/tegra2_mmc.c index renamed from drivers/mmc/tegra2_mmc.c +0 -0

33cc8fb..fb8a57d 100644

drivers/mmc/tegra2_mmc.c +1 -2
@@ -162,7 +162,7 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd
 *cmd,
 	struct mmc_host *host = (struct mmc_host *)mmc->priv;
 	int flags, i;
 	int result;
-	unsigned int mask;
+	unsigned int mask = 0;
 	unsigned int retry = 0x100000;
 	debug(" mmc_send_cmd called\n");
 
--

1.7.7.6

Signature · 1 line
nvpublic
#2 lore raw

PATCH 1/1 drivers/mmc/tegra2_mmc.c: fix GCC 4.6 warning

In reply to Anatolij Gustschin

Dear Anatolij Gustschin,

Quoted 8 lines · In message <[email protected]> you wrote:

Fix:
tegra2_mmc.c: In function 'mmc_send_cmd':
tegra2_mmc.c:230:3: warning: 'mask' may be used uninitialized in this function [-Wuninitialized]

Quoted 8 lines

---
gcc is wrong here, I think. But I'd like to have a clean build log.

Anatolij

 drivers/mmc/tegra2_mmc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Tom, Albert: hope this is OK with you; it fixes some real issues, and I want to get clear for -rc1.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Command, n.:
            Statement presented by a human and accepted by a computer
in such a manner as to make the human feel as if he is in control.