[coreboot-gerrit] Change in coreboot[master]: drivers/storage: Work around GCC data flow issue

Lee Leahy (Code Review) gerrit at coreboot.org
Mon Mar 27 21:39:56 CEST 2017


Lee Leahy has uploaded a new change for review. ( https://review.coreboot.org/19005 )

Change subject: drivers/storage: Work around GCC data flow issue
......................................................................

drivers/storage: Work around GCC data flow issue

Fix the following error detected by GCC:

error: 'clock' may be used uninitialized in this function [-Werror=maybe-uninitialized]

TEST=Build for reef

Change-Id: I46d7d87265b1011f719ebcb32f63443f2de8e266
Signed-off-by: Lee Leahy <Leroy.P.Leahy at intel.com>
---
M src/drivers/storage/mmc.c
1 file changed, 2 insertions(+), 4 deletions(-)


  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/05/19005/1

diff --git a/src/drivers/storage/mmc.c b/src/drivers/storage/mmc.c
index b877548..2e1516b 100644
--- a/src/drivers/storage/mmc.c
+++ b/src/drivers/storage/mmc.c
@@ -512,19 +512,17 @@
 	uint32_t clock;
 
 	if (IS_SD(media)) {
+		clock = MMC_CLOCK_25MHZ;
 		if (media->caps & MMC_MODE_HS)
 			clock = MMC_CLOCK_50MHZ;
-		else
-			clock = MMC_CLOCK_25MHZ;
 	} else {
+		clock = MMC_CLOCK_26MHZ;
 		if (media->caps & MMC_MODE_HS) {
 			if ((media->caps & MMC_MODE_HS_200MHz) ||
 			    (media->caps & MMC_MODE_HS400ES))
 				clock = MMC_CLOCK_200MHZ;
 			else if (media->caps & MMC_MODE_HS_52MHz)
 				clock = MMC_CLOCK_52MHZ;
-			else
-				clock = MMC_CLOCK_26MHZ;
 		}
 	}
 

-- 
To view, visit https://review.coreboot.org/19005
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I46d7d87265b1011f719ebcb32f63443f2de8e266
Gerrit-PatchSet: 1
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Lee Leahy <leroy.p.leahy at intel.com>



More information about the coreboot-gerrit mailing list