From patchwork Mon Feb 13 14:40:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9569895 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 48CF760578 for ; Mon, 13 Feb 2017 14:40:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D65327F8C for ; Mon, 13 Feb 2017 14:40:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2204027FAD; Mon, 13 Feb 2017 14:40:51 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 23D7F27F8C for ; Mon, 13 Feb 2017 14:40:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751935AbdBMOks (ORCPT ); Mon, 13 Feb 2017 09:40:48 -0500 Received: from mail-lf0-f41.google.com ([209.85.215.41]:33948 "EHLO mail-lf0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751626AbdBMOkr (ORCPT ); Mon, 13 Feb 2017 09:40:47 -0500 Received: by mail-lf0-f41.google.com with SMTP id v186so51327908lfa.1 for ; Mon, 13 Feb 2017 06:40:46 -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; bh=qGDUzvvNzKxmc4+neHWL+CnhyfP6T/NHWFg9b4/ezYI=; b=TwRx6u9sOcKs52/Cve1I2ordB7cbl/cSxsh1pooHr2tjVT5jEKZkDTW6PSDOdeFpZ7 nYkIoqHtwLH/eEmwwcHNyTetVKJKg7PJHSwFAD42BvI3u0QCT23zsfPt81cyU9RasWW7 9dt0wLLN6G0WTJf2n543Q3ecvM7E+ST4SxKbA= 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; bh=qGDUzvvNzKxmc4+neHWL+CnhyfP6T/NHWFg9b4/ezYI=; b=jF1wDHDlqXTyGNNFk627fUzDYUq/6JQQRy0HasSqyY9We7St8kNBnRLy2tlzWrRRhq bV/IjggWIR0AN9mTaul+lFFhXChE0l7UWoxMOl0alezV1papq/tcrv0AHVBWcGDIMnG4 QlSI3S5OlLzHqhi1bsiXQz5psfw5ECoRxMX98fY0kLJUJ6NyBG86CZ9bTy9bsFmTFKfL E62XbtOL+M4p9KiJ6wv8XU2lykaXrHUhXv20bot818DA/SiKdOJxLNtFT/2qwBKrUGTx q86YmcntYsAqvVylA0k6n/VidY1UzP7jf8Ec73cFuA6Gi0vus+Z+1i4OfetqOkcCoFC8 m0jw== X-Gm-Message-State: AMke39kgaKveVVBxXvdgMCX5b9FIkTKLNZuutBIvYKiNpN/QcgEocckGgGy+T3/Lq1PF0mlv X-Received: by 10.25.204.197 with SMTP id c188mr5551757lfg.107.1486996845853; Mon, 13 Feb 2017 06:40:45 -0800 (PST) Received: from gnarp.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id h13sm2802608ljh.5.2017.02.13.06.40.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Feb 2017 06:40:44 -0800 (PST) From: Linus Walleij To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Chunyan Zhang , Baolin Wang , Linus Walleij Subject: [PATCH] mmc: block: return errorcode and not 0 Date: Mon, 13 Feb 2017 15:40:38 +0100 Message-Id: <20170213144038.975-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 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 The function mmc_sd_num_wr_blocks() was changed in 9a5e7ddc7954: "mmc: block: return errorcode from mmc_sd_num_wr_blocks()" to return err; but this was fixed in 65f2da1ecb36: "mmc: block: return 0 where evident" as clearly err was anyways zero. Well the first commit was wrong, we should have returned an errorcode all the time. Reported-by: Dan Carpenter Fixes: 65f2da1ecb36: ("mmc: block: return 0 where evident") Signed-off-by: Linus Walleij --- Ulf please apply this for fixes. --- 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 985477cdcb3e..cd909aecfded 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -783,7 +783,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 0; + return -EIO; memset(&cmd, 0, sizeof(struct mmc_command));