Add a incremental updates to fix a bug that prev_err is uninitialized.
Signed-off-by: William Qiu <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
---
drivers/mmc/host/dw_mmc-starfive.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/host/dw_mmc-starfive.c b/drivers/mmc/host/dw_mmc-starfive.c
index 40f5969b07a6..dab1508bf83c 100644
--- a/drivers/mmc/host/dw_mmc-starfive.c
+++ b/drivers/mmc/host/dw_mmc-starfive.c
@@ -51,7 +51,7 @@ static int dw_mci_starfive_execute_tuning(struct dw_mci_slot *slot,
struct dw_mci *host = slot->host;
struct starfive_priv *priv = host->priv;
int rise_point = -1, fall_point = -1;
- int err, prev_err;
+ int err, prev_err = 0;
int i;
bool found = 0;
u32 regval;
--
2.34.1
On Tue, 7 Mar 2023 at 03:49, William Qiu <[email protected]> wrote:
> Add a incremental updates to fix a bug that prev_err is uninitialized.
>
> Signed-off-by: William Qiu <[email protected]>
> Reported-by: Dan Carpenter <[email protected]>
Reviewed-by: Emil Renner Berthing <[email protected]>
> ---
> drivers/mmc/host/dw_mmc-starfive.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/dw_mmc-starfive.c b/drivers/mmc/host/dw_mmc-starfive.c
> index 40f5969b07a6..dab1508bf83c 100644
> --- a/drivers/mmc/host/dw_mmc-starfive.c
> +++ b/drivers/mmc/host/dw_mmc-starfive.c
> @@ -51,7 +51,7 @@ static int dw_mci_starfive_execute_tuning(struct dw_mci_slot *slot,
> struct dw_mci *host = slot->host;
> struct starfive_priv *priv = host->priv;
> int rise_point = -1, fall_point = -1;
> - int err, prev_err;
> + int err, prev_err = 0;
> int i;
> bool found = 0;
> u32 regval;
> --
> 2.34.1
>
>
> _______________________________________________
> linux-riscv mailing list
> [email protected]
> http://lists.infradead.org/mailman/listinfo/linux-riscv
On Tue, 7 Mar 2023 at 03:46, William Qiu <[email protected]> wrote:
>
> Add a incremental updates to fix a bug that prev_err is uninitialized.
>
> Signed-off-by: William Qiu <[email protected]>
> Reported-by: Dan Carpenter <[email protected]>
I took the liberty of updating the commit message a bit, to try to
further clarify things. Moreover, future wise, let's use the prefix,
"mmc: dw_mmc-starfive" for the commit message header, to be consistent
with the other dw_mmc drivers.
So, applied for fixes and by adding a fixes tag, thanks!
Kind regards
Uffe
> ---
> drivers/mmc/host/dw_mmc-starfive.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/dw_mmc-starfive.c b/drivers/mmc/host/dw_mmc-starfive.c
> index 40f5969b07a6..dab1508bf83c 100644
> --- a/drivers/mmc/host/dw_mmc-starfive.c
> +++ b/drivers/mmc/host/dw_mmc-starfive.c
> @@ -51,7 +51,7 @@ static int dw_mci_starfive_execute_tuning(struct dw_mci_slot *slot,
> struct dw_mci *host = slot->host;
> struct starfive_priv *priv = host->priv;
> int rise_point = -1, fall_point = -1;
> - int err, prev_err;
> + int err, prev_err = 0;
> int i;
> bool found = 0;
> u32 regval;
> --
> 2.34.1
>