Skip to content

Commit

Permalink
mmc: mediatek: Preinitialize delay_phase in get_best_delay()
Browse files Browse the repository at this point in the history
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 <geert@linux-m68k.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
Geert Uytterhoeven authored and Ulf Hansson committed Nov 9, 2015
1 parent ae3fbdd commit 62d494c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mmc/host/mtk-sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 62d494c

Please sign in to comment.