From patchwork Wed Feb 1 12:47:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 93019 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp2301284obz; Wed, 1 Feb 2017 04:49:14 -0800 (PST) X-Received: by 10.84.217.18 with SMTP id o18mr4186330pli.51.1485953354237; Wed, 01 Feb 2017 04:49:14 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b69si19054885pfk.235.2017.02.01.04.49.14; Wed, 01 Feb 2017 04:49:14 -0800 (PST) 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 sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750985AbdBAMtN (ORCPT + 5 others); Wed, 1 Feb 2017 07:49:13 -0500 Received: from mail-lf0-f51.google.com ([209.85.215.51]:34890 "EHLO mail-lf0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750971AbdBAMtM (ORCPT ); Wed, 1 Feb 2017 07:49:12 -0500 Received: by mail-lf0-f51.google.com with SMTP id n124so227408844lfd.2 for ; Wed, 01 Feb 2017 04:49:12 -0800 (PST) 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=zDYOtkRlGekN8mZHZKWSzR8kTc70vmMcmj9PXKzWVcw=; b=Iped04yacvAJTmXmUMs/b1W0vHdfeLgpi5zm9SQahDioltcQKD5iuI/dFEqwiP8ZZO w859f6FWAijvfC3dvoo008F+9CUobbuv0iOVNz0lrAQtArTQlhltjAIWZLsgOdI6B+/u rF8jKkxsCb5adXLHQ6VZmGuqdeSQnBVYYoydo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zDYOtkRlGekN8mZHZKWSzR8kTc70vmMcmj9PXKzWVcw=; b=c5s4iSGPAlWrJ6aAzYxPXi9pY2jmkfaf/7JhaFexHWAlxJQtjG21awYqn0e1Sa9o5h +LLnHOdMFDueoQUwYiTx0B0hBF7bIv/04wMoh7jshTGtwbgnq4lt8CO3cfEF8q5i3GvZ XhNewTLdvEL09NAC2Q/pXmAqbTND/N1MumOPI4LsN/a+wecJgo5ZsMbfjTEPehCBlRI9 tLx5o/lrH7tQ5ujoPGEVpdY3HCKxbZB8z6UkD5GAa1ZCNY0xifo90OwH2pJyfjZPhi+s AKgO/mC8ExUoK1qwi9qgYdFmM4WGRAxxS47kRmkuPb/HCD3nvnv4hSLWI6+IzFsb0UFO Gf5A== X-Gm-Message-State: AIkVDXKBrpfGBCimyreS7ZDvqmO0lTQGa3E7zvZdw8/hvr6QObWDQdV5EkfrEBM5ZqiwPiWm X-Received: by 10.25.27.147 with SMTP id b141mr1048108lfb.183.1485953351246; Wed, 01 Feb 2017 04:49:11 -0800 (PST) Received: from gnarp.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id t126sm5707754lff.31.2017.02.01.04.49.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Feb 2017 04:49:10 -0800 (PST) From: Linus Walleij To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Chunyan Zhang , Baolin Wang , Linus Walleij Subject: [PATCH 09/10] mmc: block: return 0 where evident Date: Wed, 1 Feb 2017 13:47:59 +0100 Message-Id: <20170201124800.13865-10-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170201124800.13865-1-linus.walleij@linaro.org> References: <20170201124800.13865-1-linus.walleij@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org mmc_sd_num_wr_blocks() has this construction: if (err) return err; if (some_other_stuff_not_touching_err) return err; It follows from logical deduction that we can just return 0 in the latter case. Signed-off-by: Linus Walleij --- drivers/mmc/core/block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.3 -- 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/core/block.c b/drivers/mmc/core/block.c index 92f7772ca56d..c49c90dba839 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -788,7 +788,7 @@ static int mmc_sd_num_wr_blocks(struct mmc_card *card, u32 *written_blocks) if (err) return err; if (!mmc_host_is_spi(card->host) && !(cmd.resp[0] & R1_APP_CMD)) - return err; + return 0; memset(&cmd, 0, sizeof(struct mmc_command));