Skip to content

Commit

Permalink
mmc: block: convert ecc_err to a bool
Browse files Browse the repository at this point in the history
The ecc_err flag is only assigned 0 or 1 and treated as a bool,
so convert it to a bool.

Cc: Chunyan Zhang <zhang.chunyan@linaro.org>
Cc: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
Linus Walleij authored and Ulf Hansson committed Nov 29, 2016
1 parent c44d6ce commit 2cc6458
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/mmc/card/block.c
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ static int mmc_blk_cmd_error(struct request *req, const char *name, int error,
* Otherwise we don't understand what happened, so abort.
*/
static int mmc_blk_cmd_recovery(struct mmc_card *card, struct request *req,
struct mmc_blk_request *brq, int *ecc_err, bool *gen_err)
struct mmc_blk_request *brq, bool *ecc_err, bool *gen_err)
{
bool prev_cmd_status_valid = true;
u32 status, stop_status = 0;
Expand Down Expand Up @@ -1053,7 +1053,7 @@ static int mmc_blk_cmd_recovery(struct mmc_card *card, struct request *req,
if ((status & R1_CARD_ECC_FAILED) ||
(brq->stop.resp[0] & R1_CARD_ECC_FAILED) ||
(brq->cmd.resp[0] & R1_CARD_ECC_FAILED))
*ecc_err = 1;
*ecc_err = true;

/* Flag General errors */
if (!mmc_host_is_spi(card->host) && rq_data_dir(req) != READ)
Expand Down Expand Up @@ -1085,7 +1085,7 @@ static int mmc_blk_cmd_recovery(struct mmc_card *card, struct request *req,
}

if (stop_status & R1_CARD_ECC_FAILED)
*ecc_err = 1;
*ecc_err = true;
}

/* Check for set block count errors */
Expand Down Expand Up @@ -1328,7 +1328,7 @@ static int mmc_blk_err_check(struct mmc_card *card,
struct mmc_blk_request *brq = &mq_mrq->brq;
struct request *req = mq_mrq->req;
int need_retune = card->host->need_retune;
int ecc_err = 0;
bool ecc_err = false;
bool gen_err = false;

/*
Expand Down

0 comments on commit 2cc6458

Please sign in to comment.