mirror of https://gitee.com/openkylin/linux.git
mmc: block: make gen_err a bool variable
This gen_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>
This commit is contained in:
parent
92e0c44b92
commit
c44d6cefdf
|
@ -854,7 +854,7 @@ static int get_card_status(struct mmc_card *card, u32 *status, int retries)
|
|||
}
|
||||
|
||||
static int card_busy_detect(struct mmc_card *card, unsigned int timeout_ms,
|
||||
bool hw_busy_detect, struct request *req, int *gen_err)
|
||||
bool hw_busy_detect, struct request *req, bool *gen_err)
|
||||
{
|
||||
unsigned long timeout = jiffies + msecs_to_jiffies(timeout_ms);
|
||||
int err = 0;
|
||||
|
@ -871,7 +871,7 @@ static int card_busy_detect(struct mmc_card *card, unsigned int timeout_ms,
|
|||
if (status & R1_ERROR) {
|
||||
pr_err("%s: %s: error sending status cmd, status %#x\n",
|
||||
req->rq_disk->disk_name, __func__, status);
|
||||
*gen_err = 1;
|
||||
*gen_err = true;
|
||||
}
|
||||
|
||||
/* We may rely on the host hw to handle busy detection.*/
|
||||
|
@ -902,7 +902,7 @@ static int card_busy_detect(struct mmc_card *card, unsigned int timeout_ms,
|
|||
}
|
||||
|
||||
static int send_stop(struct mmc_card *card, unsigned int timeout_ms,
|
||||
struct request *req, int *gen_err, u32 *stop_status)
|
||||
struct request *req, bool *gen_err, u32 *stop_status)
|
||||
{
|
||||
struct mmc_host *host = card->host;
|
||||
struct mmc_command cmd = {0};
|
||||
|
@ -940,7 +940,7 @@ static int send_stop(struct mmc_card *card, unsigned int timeout_ms,
|
|||
(*stop_status & R1_ERROR)) {
|
||||
pr_err("%s: %s: general error sending stop command, resp %#x\n",
|
||||
req->rq_disk->disk_name, __func__, *stop_status);
|
||||
*gen_err = 1;
|
||||
*gen_err = true;
|
||||
}
|
||||
|
||||
return card_busy_detect(card, timeout_ms, use_r1b_resp, req, gen_err);
|
||||
|
@ -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, int *gen_err)
|
||||
struct mmc_blk_request *brq, int *ecc_err, bool *gen_err)
|
||||
{
|
||||
bool prev_cmd_status_valid = true;
|
||||
u32 status, stop_status = 0;
|
||||
|
@ -1062,7 +1062,7 @@ static int mmc_blk_cmd_recovery(struct mmc_card *card, struct request *req,
|
|||
pr_err("%s: %s: general error sending stop or status command, stop cmd response %#x, card status %#x\n",
|
||||
req->rq_disk->disk_name, __func__,
|
||||
brq->stop.resp[0], status);
|
||||
*gen_err = 1;
|
||||
*gen_err = true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1328,7 +1328,8 @@ 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, gen_err = 0;
|
||||
int ecc_err = 0;
|
||||
bool gen_err = false;
|
||||
|
||||
/*
|
||||
* sbc.error indicates a problem with the set block count
|
||||
|
@ -1378,7 +1379,7 @@ static int mmc_blk_err_check(struct mmc_card *card,
|
|||
pr_err("%s: %s: general error sending stop command, stop cmd response %#x\n",
|
||||
req->rq_disk->disk_name, __func__,
|
||||
brq->stop.resp[0]);
|
||||
gen_err = 1;
|
||||
gen_err = true;
|
||||
}
|
||||
|
||||
err = card_busy_detect(card, MMC_BLK_TIMEOUT_MS, false, req,
|
||||
|
|
Loading…
Reference in New Issue