2021-01-13 11:37:00

by Yue Hu

[permalink] [raw]
Subject: [PATCH] mmc: core: remove needless err = 0 in mmc_init_card()

From: Yue Hu <[email protected]>

Since they will always being in successful path to return 0 directly,
no need to set err = 0.

Signed-off-by: Yue Hu <[email protected]>
---
drivers/mmc/core/mmc.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index ff3063c..54ab1c7 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1697,7 +1697,6 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
goto free_card;

if (err) {
- err = 0;
/*
* Just disable enhanced area off & sz
* will try to enable ERASE_GROUP_DEF
@@ -1802,7 +1801,6 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
pr_warn("%s: Enabling HPI failed\n",
mmc_hostname(card->host));
card->ext_csd.hpi_en = 0;
- err = 0;
} else {
card->ext_csd.hpi_en = 1;
}
@@ -1831,7 +1829,6 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
pr_warn("%s: Cache is supported, but failed to turn on (%d)\n",
mmc_hostname(card->host), err);
card->ext_csd.cache_ctrl = 0;
- err = 0;
} else {
card->ext_csd.cache_ctrl = 1;
}
@@ -1851,7 +1848,6 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
mmc_hostname(card->host));
card->ext_csd.cmdq_support = false;
card->ext_csd.cmdq_depth = 0;
- err = 0;
}
}
/*
--
1.9.1


2021-01-13 13:11:40

by Ulf Hansson

[permalink] [raw]
Subject: Re: [PATCH] mmc: core: remove needless err = 0 in mmc_init_card()

On Wed, 13 Jan 2021 at 12:34, Yue Hu <[email protected]> wrote:
>
> From: Yue Hu <[email protected]>
>
> Since they will always being in successful path to return 0 directly,
> no need to set err = 0.
>
> Signed-off-by: Yue Hu <[email protected]>

Applied for next, thanks!

Kind regards
Uffe


> ---
> drivers/mmc/core/mmc.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index ff3063c..54ab1c7 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -1697,7 +1697,6 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
> goto free_card;
>
> if (err) {
> - err = 0;
> /*
> * Just disable enhanced area off & sz
> * will try to enable ERASE_GROUP_DEF
> @@ -1802,7 +1801,6 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
> pr_warn("%s: Enabling HPI failed\n",
> mmc_hostname(card->host));
> card->ext_csd.hpi_en = 0;
> - err = 0;
> } else {
> card->ext_csd.hpi_en = 1;
> }
> @@ -1831,7 +1829,6 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
> pr_warn("%s: Cache is supported, but failed to turn on (%d)\n",
> mmc_hostname(card->host), err);
> card->ext_csd.cache_ctrl = 0;
> - err = 0;
> } else {
> card->ext_csd.cache_ctrl = 1;
> }
> @@ -1851,7 +1848,6 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
> mmc_hostname(card->host));
> card->ext_csd.cmdq_support = false;
> card->ext_csd.cmdq_depth = 0;
> - err = 0;
> }
> }
> /*
> --
> 1.9.1
>