From patchwork Fri Jan 8 02:15:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 7981981 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DEA09BEEE5 for ; Fri, 8 Jan 2016 02:22:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F0BD120149 for ; Fri, 8 Jan 2016 02:22:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 001DA20142 for ; Fri, 8 Jan 2016 02:22:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753961AbcAHCWj (ORCPT ); Thu, 7 Jan 2016 21:22:39 -0500 Received: from condef004-v.nifty.com ([210.131.4.241]:43691 "EHLO condef004-v.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753959AbcAHCWi (ORCPT ); Thu, 7 Jan 2016 21:22:38 -0500 X-Greylist: delayed 345 seconds by postgrey-1.27 at vger.kernel.org; Thu, 07 Jan 2016 21:22:37 EST Received: from conuserg011-v.nifty.com ([10.16.229.198])by condef004-v.nifty.com with ESMTP id u082FAJ3000337 for ; Fri, 8 Jan 2016 11:15:10 +0900 Received: from beagle.diag.org (p14090-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.90]) (authenticated) by conuserg011-v.nifty.com with ESMTP id u082EmNR023708; Fri, 8 Jan 2016 11:14:48 +0900 X-Nifty-SrcIP: [153.142.97.90] From: Masahiro Yamada To: linux-mmc@vger.kernel.org Cc: Masahiro Yamada , Adrian Hunter , linux-kernel@vger.kernel.org, Jaehoon Chung , Chaotian Jing , Ulf Hansson Subject: [PATCH] mmc: remove unnecessary assignment statements before return Date: Fri, 8 Jan 2016 11:15:25 +0900 Message-Id: <1452219325-25357-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Variable assignment just before return is redundant. Signed-off-by: Masahiro Yamada --- drivers/mmc/core/mmc_ops.c | 19 ++++--------------- drivers/mmc/core/sd_ops.c | 7 +------ drivers/mmc/core/sdio_ops.c | 3 +-- 3 files changed, 6 insertions(+), 23 deletions(-) diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c index 1f44426..ddbb918 100644 --- a/drivers/mmc/core/mmc_ops.c +++ b/drivers/mmc/core/mmc_ops.c @@ -90,7 +90,6 @@ int mmc_send_status(struct mmc_card *card, u32 *status) static int _mmc_select_card(struct mmc_host *host, struct mmc_card *card) { - int err; struct mmc_command cmd = {0}; BUG_ON(!host); @@ -105,11 +104,7 @@ static int _mmc_select_card(struct mmc_host *host, struct mmc_card *card) cmd.flags = MMC_RSP_NONE | MMC_CMD_AC; } - err = mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES); - if (err) - return err; - - return 0; + return mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES); } int mmc_select_card(struct mmc_card *card) @@ -244,7 +239,6 @@ int mmc_all_send_cid(struct mmc_host *host, u32 *cid) int mmc_set_relative_addr(struct mmc_card *card) { - int err; struct mmc_command cmd = {0}; BUG_ON(!card); @@ -254,11 +248,7 @@ int mmc_set_relative_addr(struct mmc_card *card) cmd.arg = card->rca << 16; cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; - err = mmc_wait_for_cmd(card->host, &cmd, MMC_CMD_RETRIES); - if (err) - return err; - - return 0; + return mmc_wait_for_cmd(card->host, &cmd, MMC_CMD_RETRIES); } static int @@ -736,7 +726,7 @@ mmc_send_bus_test(struct mmc_card *card, struct mmc_host *host, u8 opcode, int mmc_bus_test(struct mmc_card *card, u8 bus_width) { - int err, width; + int width; if (bus_width == MMC_BUS_WIDTH_8) width = 8; @@ -752,8 +742,7 @@ int mmc_bus_test(struct mmc_card *card, u8 bus_width) * is a problem. This improves chances that the test will work. */ mmc_send_bus_test(card, card->host, MMC_BUS_TEST_W, width); - err = mmc_send_bus_test(card, card->host, MMC_BUS_TEST_R, width); - return err; + return mmc_send_bus_test(card, card->host, MMC_BUS_TEST_R, width); } int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status) diff --git a/drivers/mmc/core/sd_ops.c b/drivers/mmc/core/sd_ops.c index 48d0c93..16b774c 100644 --- a/drivers/mmc/core/sd_ops.c +++ b/drivers/mmc/core/sd_ops.c @@ -120,7 +120,6 @@ EXPORT_SYMBOL(mmc_wait_for_app_cmd); int mmc_app_set_bus_width(struct mmc_card *card, int width) { - int err; struct mmc_command cmd = {0}; BUG_ON(!card); @@ -140,11 +139,7 @@ int mmc_app_set_bus_width(struct mmc_card *card, int width) return -EINVAL; } - err = mmc_wait_for_app_cmd(card->host, card, &cmd, MMC_CMD_RETRIES); - if (err) - return err; - - return 0; + return mmc_wait_for_app_cmd(card->host, card, &cmd, MMC_CMD_RETRIES); } int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr) diff --git a/drivers/mmc/core/sdio_ops.c b/drivers/mmc/core/sdio_ops.c index 62508b4..34f6e80 100644 --- a/drivers/mmc/core/sdio_ops.c +++ b/drivers/mmc/core/sdio_ops.c @@ -217,7 +217,6 @@ int sdio_reset(struct mmc_host *host) else abort |= 0x08; - ret = mmc_io_rw_direct_host(host, 1, 0, SDIO_CCCR_ABORT, abort, NULL); - return ret; + return mmc_io_rw_direct_host(host, 1, 0, SDIO_CCCR_ABORT, abort, NULL); }