From 5b9a6656072f1c78358b310df59fb77f48038bdf Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 6 Nov 2015 12:22:08 +0100 Subject: [PATCH] UPSTREAM: mmc: mediatek: Preinitialize delay_phase in get_best_delay() drivers/mmc/host/mtk-sd.c: In function get_best_delay: drivers/mmc/host/mtk-sd.c:1284: warning: delay_phase.start is used uninitialized in this function drivers/mmc/host/mtk-sd.c:1284: warning: delay_phase.maxlen is used uninitialized in this function If delay is zero, these fields are indeed not initialized. Let the compiler preinitialize the whole struct to fix this. Signed-off-by: Geert Uytterhoeven Signed-off-by: Ulf Hansson (cherry picked from commit 62d494ca2773563e333e670cd18378705dad32d4) https://git.linaro.org/people/ulf.hansson/mmc.git next) Signed-off-by: Wei-Ning Huang BUG=chrome-os-partner:41746 TEST=`emerge-oak chromeos-kernel-3_18` Change-Id: I784301cbd630353248c165aba34596b4eda9b12d Reviewed-on: https://chromium-review.googlesource.com/311980 Commit-Ready: Wei-Ning Huang Tested-by: Wei-Ning Huang Reviewed-by: Derek Basehore --- drivers/mmc/host/mtk-sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index 39568cc29a2a1..33dfd7e72516c 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -1276,7 +1276,7 @@ static struct msdc_delay_phase get_best_delay(struct msdc_host *host, u32 delay) int start = 0, len = 0; int start_final = 0, len_final = 0; u8 final_phase = 0xff; - struct msdc_delay_phase delay_phase; + struct msdc_delay_phase delay_phase = { 0, }; if (delay == 0) { dev_err(host->dev, "phase error: [map:%x]\n", delay);