Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1477038 > unrolled thread
| Started by | Baolin Wang <baolin.wang@linaro.org> |
|---|---|
| First post | 2016-09-06 05:00 +0200 |
| Last post | 2016-09-06 14:40 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH v4 1/3] mmc: core: Remove some redundant validations in mmc_erase() function Baolin Wang <baolin.wang@linaro.org> - 2016-09-06 05:00 +0200
Re: [PATCH v4 1/3] mmc: core: Remove some redundant validations in mmc_erase() function Ulf Hansson <ulf.hansson@linaro.org> - 2016-09-06 14:20 +0200
Re: [PATCH v4 1/3] mmc: core: Remove some redundant validations in mmc_erase() function Baolin Wang <baolin.wang@linaro.org> - 2016-09-06 14:40 +0200
| From | Baolin Wang <baolin.wang@linaro.org> |
|---|---|
| Date | 2016-09-06 05:00 +0200 |
| Subject | [PATCH v4 1/3] mmc: core: Remove some redundant validations in mmc_erase() function |
| Message-ID | <seeM9-4kM-3@gated-at.bofh.it> |
Before issuing mmc_erase() function, users always have checked if it can erase with mmc_can_erase/trim/discard() function, thus remove the redundant erase checking in mmc_erase() function. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Tested-by: Shawn Lin <shawn.lin@rock-chips.com> --- Changes since v3: - Split into 3 separate patches. - Add test tag by Shawn. Changes since v2: - Add nr checking and other optimization in mmc_erase() function. Changes since v1: - Add the alignment if card->erase_size is not power of 2. --- drivers/mmc/core/core.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index e55cde6..7d7209d 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2217,13 +2217,6 @@ int mmc_erase(struct mmc_card *card, unsigned int from, unsigned int nr, unsigned int rem, to = from + nr; int err; - if (!(card->host->caps & MMC_CAP_ERASE) || - !(card->csd.cmdclass & CCC_ERASE)) - return -EOPNOTSUPP; - - if (!card->erase_size) - return -EOPNOTSUPP; - if (mmc_card_sd(card) && arg != MMC_ERASE_ARG) return -EOPNOTSUPP; -- 1.7.9.5
[toc] | [next] | [standalone]
| From | Ulf Hansson <ulf.hansson@linaro.org> |
|---|---|
| Date | 2016-09-06 14:20 +0200 |
| Subject | Re: [PATCH v4 1/3] mmc: core: Remove some redundant validations in mmc_erase() function |
| Message-ID | <senw6-1UN-31@gated-at.bofh.it> |
| In reply to | #1477038 |
On 6 September 2016 at 04:55, Baolin Wang <baolin.wang@linaro.org> wrote: > Before issuing mmc_erase() function, users always have checked if it can > erase with mmc_can_erase/trim/discard() function, thus remove the redundant > erase checking in mmc_erase() function. > > Signed-off-by: Baolin Wang <baolin.wang@linaro.org> > Tested-by: Shawn Lin <shawn.lin@rock-chips.com> > --- > Changes since v3: > - Split into 3 separate patches. > - Add test tag by Shawn. > > Changes since v2: > - Add nr checking and other optimization in mmc_erase() function. > > Changes since v1: > - Add the alignment if card->erase_size is not power of 2. > --- > drivers/mmc/core/core.c | 7 ------- > 1 file changed, 7 deletions(-) > > diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c > index e55cde6..7d7209d 100644 > --- a/drivers/mmc/core/core.c > +++ b/drivers/mmc/core/core.c > @@ -2217,13 +2217,6 @@ int mmc_erase(struct mmc_card *card, unsigned int from, unsigned int nr, > unsigned int rem, to = from + nr; > int err; > > - if (!(card->host->caps & MMC_CAP_ERASE) || > - !(card->csd.cmdclass & CCC_ERASE)) > - return -EOPNOTSUPP; > - > - if (!card->erase_size) > - return -EOPNOTSUPP; > - Could we postpone this until after a clean-up-series of the mmc erase functions? Until the function remains an exported API, I think it should keep doing this validations. > if (mmc_card_sd(card) && arg != MMC_ERASE_ARG) > return -EOPNOTSUPP; > > -- > 1.7.9.5 > Kind regards Uffe
[toc] | [prev] | [next] | [standalone]
| From | Baolin Wang <baolin.wang@linaro.org> |
|---|---|
| Date | 2016-09-06 14:40 +0200 |
| Subject | Re: [PATCH v4 1/3] mmc: core: Remove some redundant validations in mmc_erase() function |
| Message-ID | <senPr-22U-11@gated-at.bofh.it> |
| In reply to | #1477318 |
On 6 September 2016 at 20:17, Ulf Hansson <ulf.hansson@linaro.org> wrote: > On 6 September 2016 at 04:55, Baolin Wang <baolin.wang@linaro.org> wrote: >> Before issuing mmc_erase() function, users always have checked if it can >> erase with mmc_can_erase/trim/discard() function, thus remove the redundant >> erase checking in mmc_erase() function. >> >> Signed-off-by: Baolin Wang <baolin.wang@linaro.org> >> Tested-by: Shawn Lin <shawn.lin@rock-chips.com> >> --- >> Changes since v3: >> - Split into 3 separate patches. >> - Add test tag by Shawn. >> >> Changes since v2: >> - Add nr checking and other optimization in mmc_erase() function. >> >> Changes since v1: >> - Add the alignment if card->erase_size is not power of 2. >> --- >> drivers/mmc/core/core.c | 7 ------- >> 1 file changed, 7 deletions(-) >> >> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c >> index e55cde6..7d7209d 100644 >> --- a/drivers/mmc/core/core.c >> +++ b/drivers/mmc/core/core.c >> @@ -2217,13 +2217,6 @@ int mmc_erase(struct mmc_card *card, unsigned int from, unsigned int nr, >> unsigned int rem, to = from + nr; >> int err; >> >> - if (!(card->host->caps & MMC_CAP_ERASE) || >> - !(card->csd.cmdclass & CCC_ERASE)) >> - return -EOPNOTSUPP; >> - >> - if (!card->erase_size) >> - return -EOPNOTSUPP; >> - > > Could we postpone this until after a clean-up-series of the mmc erase functions? > > Until the function remains an exported API, I think it should keep > doing this validations. OK. That's reasonable. > >> if (mmc_card_sd(card) && arg != MMC_ERASE_ARG) >> return -EOPNOTSUPP; >> >> -- >> 1.7.9.5 >> > > Kind regards > Uffe -- Baolin.wang Best Regards
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web