From patchwork Fri Nov 4 10:05:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9412347 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CE9B260724 for ; Fri, 4 Nov 2016 10:05:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C046D2AD8C for ; Fri, 4 Nov 2016 10:05:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B547F2ADA7; Fri, 4 Nov 2016 10:05:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30CE02AD8C for ; Fri, 4 Nov 2016 10:05:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761055AbcKDKFb (ORCPT ); Fri, 4 Nov 2016 06:05:31 -0400 Received: from mail-lf0-f43.google.com ([209.85.215.43]:35319 "EHLO mail-lf0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761027AbcKDKFa (ORCPT ); Fri, 4 Nov 2016 06:05:30 -0400 Received: by mail-lf0-f43.google.com with SMTP id b14so59818810lfg.2 for ; Fri, 04 Nov 2016 03:05:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/A3P6st66GbpWAciivNqSsFC6fYtBgMUj4E+zHR1Qko=; b=A0aZpO4yL9e++eTNR0WxuO8lCRyMTjXnEbrgHeIphFkOcbxyo46lmQx84q9VvFtGUX XO7airk87Sdk/YWkVdOU4zITCjLyASexNT92rxPpqdbD4qvwQaC5P2FPSyN+qvmM+GKu bFNEOzbBDee1ygdIKe49vxFV94uRoXVV5G5CU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/A3P6st66GbpWAciivNqSsFC6fYtBgMUj4E+zHR1Qko=; b=F4WYVUuamM2H7zVVC0arDoQrprjIHl1CKqQdlNhfBaM/8HXVokScvchwM0yMvk/Tcx XmmLYP+iISi3pcq8yufCe0Dne6LrXTRh2X4WmUrAjzOC/jZqEnjgW9X86SNJ3GKLYVvY vzIYS9iwjN1elGD+V7F3y9qOZtBC8O2d3TCK69dGPKyBfk61P2QcEwotNKotKr46SN/J X7J46qcjy3MN9zCx03jjUdpK2xjTY2LdVVRUeLQpXApea+AmtsnMlCV/Chdwjvu846J0 iw7iwHtOe+65ZpYiJpGWZ/nIppaGs0xAqg6nE1X1KB0SGGvaH+NA5d0b3ISdLvb9mqj6 bgzg== X-Gm-Message-State: ABUngve54pLzlYLMvLx75Uejhz+mJ+vasAX4IbKN6kxE63dtTYaUtIYmf3E3ds1j5Z8b9uv1 X-Received: by 10.25.77.65 with SMTP id a62mr8710268lfb.118.1478253928170; Fri, 04 Nov 2016 03:05:28 -0700 (PDT) Received: from linuslaptop.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id p13sm2209627lfp.14.2016.11.04.03.05.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Nov 2016 03:05:27 -0700 (PDT) From: Linus Walleij To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Chunyan Zhang , Baolin Wang , Linus Walleij Subject: [PATCH 1/3] mmc: block: make gen_err a bool variable Date: Fri, 4 Nov 2016 11:05:17 +0100 Message-Id: <1478253919-2469-2-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1478253919-2469-1-git-send-email-linus.walleij@linaro.org> References: <1478253919-2469-1-git-send-email-linus.walleij@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This gen_err flag is only assigned 0 or 1 and treated as a bool, so convert it to a bool. Cc: Chunyan Zhang Cc: Baolin Wang Signed-off-by: Linus Walleij --- drivers/mmc/card/block.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index c3335112e68c..54532580ef3d 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -853,7 +853,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; @@ -870,7 +870,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.*/ @@ -901,7 +901,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}; @@ -939,7 +939,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); @@ -1013,7 +1013,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; @@ -1061,7 +1061,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; } /* @@ -1327,7 +1327,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 @@ -1377,7 +1378,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,