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: 9337139 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 D345560839 for ; Sat, 17 Sep 2016 15:11:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C18AF275A2 for ; Sat, 17 Sep 2016 15:11:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B1E1728C6E; Sat, 17 Sep 2016 15:11:05 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 62A0B275A2 for ; Sat, 17 Sep 2016 15:11:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752569AbcIQPLE (ORCPT ); Sat, 17 Sep 2016 11:11:04 -0400 Received: from mout.web.de ([212.227.17.11]:65513 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751543AbcIQPLD (ORCPT ); Sat, 17 Sep 2016 11:11:03 -0400 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> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall 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 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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;