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: 93893 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp936604obz; Mon, 13 Feb 2017 06:40:49 -0800 (PST) X-Received: by 10.99.101.4 with SMTP id z4mr27539224pgb.208.1486996849537; Mon, 13 Feb 2017 06:40:49 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w12si10257415pld.23.2017.02.13.06.40.49; Mon, 13 Feb 2017 06:40:49 -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 S1751935AbdBMOks (ORCPT + 5 others); 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 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(-) -- 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 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));