From patchwork Mon Sep 12 19:20:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 76025 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp1005778qgf; Mon, 12 Sep 2016 12:22:13 -0700 (PDT) X-Received: by 10.66.243.80 with SMTP id ww16mr15096071pac.19.1473708133154; Mon, 12 Sep 2016 12:22:13 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ul1si22918651pac.252.2016.09.12.12.22.12; Mon, 12 Sep 2016 12:22:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932334AbcILTWK (ORCPT + 27 others); Mon, 12 Sep 2016 15:22:10 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:24179 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752168AbcILTWF (ORCPT ); Mon, 12 Sep 2016 15:22:05 -0400 X-Greylist: delayed 4357 seconds by postgrey-1.27 at vger.kernel.org; Mon, 12 Sep 2016 15:22:04 EDT Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-12.nifty.com with ESMTP id u8CJLJBd015110; Tue, 13 Sep 2016 04:21:21 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com u8CJLJBd015110 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1473708082; bh=d6Wfns1v1NmmTmmt2RVi6a9UOmsyftrYSVjVjXJrNmw=; h=From:To:Cc:Subject:Date:From; b=EQUL8Bkq4llX0qnyI1nuXOf3vE669zbyt8E7YgMBKWsijgbP+5/gjN5/Tfe08YjkX 3WGbEqB9kyjRg/7jYwqT3hnrZ9X5hQd8Bq/XGFpmTdXRRCwAavWQH58H5gYSxHQ+TN LXj1Hai4PX5Tn6kagE30xSSRdpEhyKRxpY/gFvSnYQB2Pvhug5A2m3uth6Y/Xv5rIG fmdspYwvpcbWM5QE1wXY4+St4vCeHVC5QHHTrlNTHPKi9OuXu8jDPF4SuFSjLn8KfJ b1CUxxhC8vL1n1KxtGN/nWAldimrKrb22hC0x1oUFs5JWvyhTQlmcmL4xR3Mo3gmSt GH1WN7gbScwHg== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: dmaengine@vger.kernel.org Cc: Masahiro Yamada , Linus Walleij , Thierry Reding , Peter Griffin , linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, Stephen Warren , Dan Williams , Jon Hunter , Vinod Koul , Laxman Dewangan , Alexandre Courbot Subject: [PATCH] dmaengine: squash lines for immediate return Date: Tue, 13 Sep 2016 04:20:54 +0900 Message-Id: <1473708054-30989-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove unneeded variables and assignments. Signed-off-by: Masahiro Yamada --- drivers/dma/cppi41.c | 30 +++++------------------------- drivers/dma/imx-sdma.c | 15 ++++----------- drivers/dma/ppc4xx/adma.c | 15 ++++++--------- drivers/dma/tegra20-apb-dma.c | 4 +--- 4 files changed, 16 insertions(+), 48 deletions(-) -- 1.9.1 diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c index 4b23174..dfad278 100644 --- a/drivers/dma/cppi41.c +++ b/drivers/dma/cppi41.c @@ -339,11 +339,7 @@ static irqreturn_t cppi41_irq(int irq, void *data) static dma_cookie_t cppi41_tx_submit(struct dma_async_tx_descriptor *tx) { - dma_cookie_t cookie; - - cookie = dma_cookie_assign(tx); - - return cookie; + return dma_cookie_assign(tx); } static int cppi41_dma_alloc_chan_resources(struct dma_chan *chan) @@ -433,11 +429,7 @@ static u32 get_host_pd0(u32 length) static u32 get_host_pd1(struct cppi41_channel *c) { - u32 reg; - - reg = 0; - - return reg; + return 0; } static u32 get_host_pd2(struct cppi41_channel *c) @@ -452,12 +444,8 @@ static u32 get_host_pd2(struct cppi41_channel *c) static u32 get_host_pd3(u32 length) { - u32 reg; - /* PD3 = packet size */ - reg = length; - - return reg; + return length; } static u32 get_host_pd6(u32 length) @@ -473,20 +461,12 @@ static u32 get_host_pd6(u32 length) static u32 get_host_pd4_or_7(u32 addr) { - u32 reg; - - reg = addr; - - return reg; + return addr; } static u32 get_host_pd5(void) { - u32 reg; - - reg = 0; - - return reg; + return 0; } static struct dma_async_tx_descriptor *cppi41_dma_prep_slave_sg( diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 03ec76f..6aaddbf 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -947,7 +947,6 @@ static void sdma_set_watermarklevel_for_p2p(struct sdma_channel *sdmac) static int sdma_config_channel(struct dma_chan *chan) { struct sdma_channel *sdmac = to_sdma_chan(chan); - int ret; sdma_disable_channel(chan); @@ -999,9 +998,7 @@ static int sdma_config_channel(struct dma_chan *chan) sdmac->watermark_level = 0; /* FIXME: M3_BASE_ADDRESS */ } - ret = sdma_load_context(sdmac); - - return ret; + return sdma_load_context(sdmac); } static int sdma_set_channel_priority(struct sdma_channel *sdmac, @@ -1520,13 +1517,9 @@ out: static int sdma_get_firmware(struct sdma_engine *sdma, const char *fw_name) { - int ret; - - ret = request_firmware_nowait(THIS_MODULE, - FW_ACTION_HOTPLUG, fw_name, sdma->dev, - GFP_KERNEL, sdma, sdma_load_firmware); - - return ret; + return request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG, fw_name, + sdma->dev, GFP_KERNEL, sdma, + sdma_load_firmware); } static int sdma_init(struct sdma_engine *sdma) diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c index da3688b..39f2138 100644 --- a/drivers/dma/ppc4xx/adma.c +++ b/drivers/dma/ppc4xx/adma.c @@ -2780,7 +2780,6 @@ static struct dma_async_tx_descriptor *ppc440spe_adma_prep_dma_xor_zero_sum( struct dma_chan *chan, dma_addr_t *src, unsigned int src_cnt, size_t len, enum sum_check_flags *result, unsigned long flags) { - struct dma_async_tx_descriptor *tx; dma_addr_t pq[2]; /* validate P, disable Q */ @@ -2788,10 +2787,9 @@ static struct dma_async_tx_descriptor *ppc440spe_adma_prep_dma_xor_zero_sum( pq[1] = 0; flags |= DMA_PREP_PQ_DISABLE_Q; - tx = ppc440spe_adma_prep_dma_pqzero_sum(chan, pq, &src[1], - src_cnt - 1, 0, len, - result, flags); - return tx; + return ppc440spe_adma_prep_dma_pqzero_sum(chan, pq, &src[1], + src_cnt - 1, 0, len, + result, flags); } /** @@ -4363,7 +4361,6 @@ static ssize_t store_ppc440spe_r6enable(struct device_driver *dev, static ssize_t show_ppc440spe_r6poly(struct device_driver *dev, char *buf) { - ssize_t size = 0; u32 reg; #ifdef CONFIG_440SP @@ -4375,9 +4372,9 @@ static ssize_t show_ppc440spe_r6poly(struct device_driver *dev, char *buf) reg &= 0xFF; #endif - size = snprintf(buf, PAGE_SIZE, "PPC440SP(e) RAID-6 driver " - "uses 0x1%02x polynomial.\n", reg); - return size; + return snprintf(buf, PAGE_SIZE, + "PPC440SP(e) RAID-6 driver uses 0x1%02x polynomial.\n", + reg); } static ssize_t store_ppc440spe_r6poly(struct device_driver *dev, diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c index 6ab9eb9..89795a2 100644 --- a/drivers/dma/tegra20-apb-dma.c +++ b/drivers/dma/tegra20-apb-dma.c @@ -337,9 +337,7 @@ static struct tegra_dma_sg_req *tegra_dma_sg_req_get( } spin_unlock_irqrestore(&tdc->lock, flags); - sg_req = kzalloc(sizeof(struct tegra_dma_sg_req), GFP_NOWAIT); - - return sg_req; + return kzalloc(sizeof(struct tegra_dma_sg_req), GFP_NOWAIT); } static int tegra_dma_slave_config(struct dma_chan *dc,