aboutsummaryrefslogtreecommitdiff
path: root/projects/depthcharge/patches/0004-mmc-Initialize-clock-variable-in-mmc_recalculate_clo.patch
blob: 3b4c5411c8541550448e4290e69700afd877d75c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 925042a09afb9529b112eff2e4d56bf979ff32ec Mon Sep 17 00:00:00 2001
From: Paul Kocialkowski <contact@paulk.fr>
Date: Mon, 19 Dec 2016 14:54:40 +0100
Subject: [PATCH 4/4] mmc: Initialize clock variable in mmc_recalculate_clock

Initializing the variable before it is used (and set to a proper value)
avoids triggering a maybe uninitialized compiler warning.

Change-Id: I0f78e534919e892e23fbe6d38bba6e68c408b0c4
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
---
 src/drivers/storage/mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/drivers/storage/mmc.c b/src/drivers/storage/mmc.c
index b877548..54306a1 100644
--- a/src/drivers/storage/mmc.c
+++ b/src/drivers/storage/mmc.c
@@ -509,7 +509,7 @@ static void mmc_set_clock(MmcCtrlr *ctrlr, uint32_t clock)
 
 static void mmc_recalculate_clock(MmcMedia *media)
 {
-	uint32_t clock;
+	uint32_t clock = 0;
 
 	if (IS_SD(media)) {
 		if (media->caps & MMC_MODE_HS)
-- 
2.10.2