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: 80797 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp1065185qge; Fri, 4 Nov 2016 03:05:38 -0700 (PDT) X-Received: by 10.99.105.70 with SMTP id e67mr13159397pgc.99.1478253938225; Fri, 04 Nov 2016 03:05:38 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ls8si12883426pab.313.2016.11.04.03.05.38; Fri, 04 Nov 2016 03:05:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761055AbcKDKFb (ORCPT + 3 others); 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 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(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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,