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: 9549655 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 79B6A60415 for ; Wed, 1 Feb 2017 12:49:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65FF628422 for ; Wed, 1 Feb 2017 12:49:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A5D128437; Wed, 1 Feb 2017 12:49:14 +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 089DC28422 for ; Wed, 1 Feb 2017 12:49:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750985AbdBAMtN (ORCPT ); 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 X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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));