All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: mediatek: Preinitialize delay_phase in get_best_delay()
@ 2015-11-06 11:22 Geert Uytterhoeven
  2015-11-09 12:44 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2015-11-06 11:22 UTC (permalink / raw)
  To: Ulf Hansson, Matthias Brugger, linux-mmc, linux-mediatek
  Cc: Geert Uytterhoeven

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>
---
 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 39568cc29a2a18cf..33dfd7e72516c392 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);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mmc: mediatek: Preinitialize delay_phase in get_best_delay()
  2015-11-06 11:22 [PATCH] mmc: mediatek: Preinitialize delay_phase in get_best_delay() Geert Uytterhoeven
@ 2015-11-09 12:44 ` Ulf Hansson
  0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2015-11-09 12:44 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Matthias Brugger, linux-mmc, linux-mediatek

On 6 November 2015 at 12:22, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> 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>

Thanks, applied for fixes!

Kind regards
Uffe

> ---
>  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 39568cc29a2a18cf..33dfd7e72516c392 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);
> --
> 1.9.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-09 12:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-06 11:22 [PATCH] mmc: mediatek: Preinitialize delay_phase in get_best_delay() Geert Uytterhoeven
2015-11-09 12:44 ` Ulf Hansson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.