From patchwork Sat Sep 17 15:10:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9337145 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 0462E60839 for ; Sat, 17 Sep 2016 15:12:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E955B275A2 for ; Sat, 17 Sep 2016 15:12:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DDC0528C6E; Sat, 17 Sep 2016 15:12:17 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CB78B275A2 for ; Sat, 17 Sep 2016 15:12:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1blHGj-0003Kz-Ee; Sat, 17 Sep 2016 15:11:05 +0000 Received: from mout.web.de ([212.227.17.11]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1blHGd-000379-LY for linux-arm-kernel@lists.infradead.org; Sat, 17 Sep 2016 15:11:00 +0000 Received: from [192.168.1.2] ([78.48.101.40]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0MWB4X-1bVXmq1xpx-00XJ9X; Sat, 17 Sep 2016 17:10:33 +0200 Subject: [PATCH 04/24] ste_dma40: Move an assignment in d40_lcla_allocate() To: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Dan Williams , Linus Walleij , Vinod Koul References: <566ABCD9.1060404@users.sourceforge.net> <92810066-69b6-94e7-dcec-a28594b1328f@users.sourceforge.net> From: SF Markus Elfring Message-ID: <5fea9143-f4af-fae7-aa7e-8bbc9c13e72f@users.sourceforge.net> Date: Sat, 17 Sep 2016 17:10:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <92810066-69b6-94e7-dcec-a28594b1328f@users.sourceforge.net> X-Provags-ID: V03:K0:B0bdFvFF8Byu8Zwq55QFAYWvwP2GvVIkjVwCBNZXVeX8Se/sagp ZeGPdX+eoVXmbzC4bNbgqxvspTxiq516NhBYS3zgeQ+zHwWbrvz7PRR5haBnuFw9MvBU//e zBPV6TeibUFwe/sYxlYjxBce329WF23gEY2iPxKm9zLjGNupQ6Oen8sSsu2SRdcY/euXSh8 C9dAEpXYWekXyil2wLrIA== X-UI-Out-Filterresults: notjunk:1; V01:K0:FycB+B8yUsQ=:JHMSjhG66EfHpgOaMShhay teG3GEuoM69dI50AGcDvNyx7+CsIYo9DvQ2+oLYGxs9TF232Ag0Xd9U1oxDDciOHxhwwq+XU1 r30U9L33j7u1wFN4h/rAMjsxHf486BHVSLjdm6L8XlePS3Ur4P1MzoGi0AfBFNeBuzgDWtHrQ l8vQ1HFfrSvnmgWxuMB2svLde4FxGxUR2gChcYxkGL7TnecBn/LHcHlwKawaG4+jiD8db4VZ+ alXLk3iEcSF9DED001l/Am2SLWXQLBwaCF727jISaFswziNoO6qbKhQzIy646hHvw/HMnmyoF UsgOBbrv485680UU2TuIJrfct0a38o52yDZMSeotv+mWMHuKRcyWO0P0c+55iFjFe09+5SyU3 JmWyxdJ8oXH9SE2NB0hG9ajoj+yRQsbYOp3DCTe2xHmpkJOotQtKSmt4N9JAsoCHjidqxemSK q13Wfd+hiYRBNjpdV3ymoZ3KXchE3S/Hrs8yUZ8Yosc5rfYyr96q+SbZeB+hPUQldaFEUr9gC l+DvuHKDkbjz/8gHDz6VyOct86xJ4Q4/QhValpbkFEOO4TSOOKPmmtdNR2T7ATh6S8aCNlkQ0 dk+Knjt0o5xXK5e48njy56irjKJzK8PNKcTwwe8Z9C4bjSSwzHC5FVC8NegDcQN7tK/s3HnvY KVTVeYBfcsvBkHOhRuSB18+XqolO81nENWi6UWqyJGkRJf3pB50P4lVl9dv14+QdgyREeEel5 x1j2kPXxLyk0YNnd41QGyavosv+xsIg4Nay3Rmbv6g/ETATUO4/yOg3+RlUkwYNVnT5VpqauX Ia0QLHa X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160917_081100_117425_CA431156 X-CRM114-Status: GOOD ( 10.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Julia Lawall , kernel-janitors@vger.kernel.org, LKML Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 17 Sep 2016 08:24:46 +0200 Move one assignment for the local variable "ret" so that its setting will only be performed after corresponding data processing succeeded by this function. Signed-off-by: Markus Elfring --- drivers/dma/ste_dma40.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 76d63b6..220129e 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -3402,7 +3402,7 @@ static int __init d40_lcla_allocate(struct d40_base *base) struct d40_lcla_pool *pool = &base->lcla_pool; unsigned long *page_list; int i, j; - int ret = 0; + int ret; /* * This is somewhat ugly. We need 8192 bytes that are 18 bit aligned, @@ -3474,6 +3474,7 @@ static int __init d40_lcla_allocate(struct d40_base *base) writel(virt_to_phys(base->lcla_pool.base), base->virtbase + D40_DREG_LCLA); + ret = 0; free_page_list: kfree(page_list); return ret;