From patchwork Sat Sep 17 15:27:57 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: 9337225 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 53FC46077F for ; Sat, 17 Sep 2016 15:28:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 453A428D18 for ; Sat, 17 Sep 2016 15:28:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A0E928D1B; Sat, 17 Sep 2016 15:28:30 +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 E472C28D18 for ; Sat, 17 Sep 2016 15:28:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752169AbcIQP22 (ORCPT ); Sat, 17 Sep 2016 11:28:28 -0400 Received: from mout.web.de ([212.227.17.11]:62063 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751543AbcIQP22 (ORCPT ); Sat, 17 Sep 2016 11:28:28 -0400 Received: from [192.168.1.2] ([78.48.101.40]) by smtp.web.de (mrweb102) with ESMTPSA (Nemesis) id 0MDg9K-1bmvg01Jb4-00HBIX; Sat, 17 Sep 2016 17:27:58 +0200 Subject: [PATCH 17/24] ste_dma40: Move an assignment in d40_prep_desc() 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: <4b7f5854-3ecd-eaa0-3c0e-d14915708e06@users.sourceforge.net> Date: Sat, 17 Sep 2016 17:27:57 +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:75uejF2ArkbQwJiqsLRJOPVnpmUl0T12cajiLHXWowm/xWQ6u3K ETmU2ShSn3m0HP2f1swhB/Rg2O6nhVE7XNetl7PlrlbVyJCUIq0KFkGomkLFWceLsKzClHG qbknynJnYFHPHCaubrxOgfUuonXEq4YWFZ9VOmel6ZQFXpwybG1fxrPdeTwFSK9/D1TxqiY Qv+r0iFpo63hgCF+e6kKA== X-UI-Out-Filterresults: notjunk:1; V01:K0:x0cVh/qzJMQ=:AScrxDdLWArQNgZf5J+wUT zVI3gV9whlgcClJtsN19nNW1RNOCmjqGSzFr09BLuuVIBL1kR73GbXcc7FfAOpEn/8WUIPsWr MBPcVw0MKwo7rxd/e+W9TmgUKf0E0IfyJ57O0RLekoNBdNM0xVanES+W/Kl6YQ+u4ZpsOLkqV yYKCOJphpvtmfefQYqctGvaTyXMDgtqj5a7sjwq3mMSsT0T5l9McWLL4cic3iDf2Mq1ehQv3X vqluJTByQedvvIv02YJKgBQP7zNKOD6Bo+Ugr9tN2twRHlB88zEVZA4+1EbsoLduODXXc23HX xEBd8bKxARIU4XERh5nS5OEBHxiMFrED26DAsRh5zylylzwpSZIdxIodHfzginiFBqIVtr6f8 z+DfCYQn9PWoilD+vRIdG6/9znptNRhT/N1Fl279GTAHseEYP+e1+6nyKlcAY8uskT5A7stNh sAokyiLx1PAGpn00QLUi014kBqk1bTS24pHkjIHBA8NsiVbz7OMwrd1vCGx2/8uo+OD8SMxED psQqRbh/lLPiq+trpGTZyCkX8ttQ2agl8GOMBvDh1piXKx++PoGK+TQdEyetu5zwO8X4bFP6r kepYjJ6TaBEe0skvdEYVKRH/Hmtfgh91HIUCgHNXuQzjfWDvHY88vD79eSDm0qfVOhg6Mh8vD gv/Q0NcMty6LRV6HfYDOGF3HHhpsVHjRi1PzmBh5JPh8OGLDXv4xxEbEOTVpldYKwIIaGwgkm hHU2d32gp4iyQjwHW7ZEo0SmA+JQIJ5I5x/0ejOvrCDewgQx18rcH66WCH0wYEiUWC92YRvKe zYlIstE 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 15:54:12 +0200 Move one assignment for the local variable "cfg" so that its setting will only be performed after a call of the function "d40_desc_get" 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 7f38496..4a21778 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -2196,7 +2196,7 @@ static struct d40_desc * d40_prep_desc(struct d40_chan *chan, struct scatterlist *sg, unsigned int sg_len, unsigned long dma_flags) { - struct stedma40_chan_cfg *cfg = &chan->dma_cfg; + struct stedma40_chan_cfg *cfg; struct d40_desc *desc; int ret; @@ -2204,6 +2204,7 @@ d40_prep_desc(struct d40_chan *chan, struct scatterlist *sg, if (!desc) return NULL; + cfg = &chan->dma_cfg; desc->lli_len = d40_sg_2_dmalen(sg, sg_len, cfg->src_info.data_width, cfg->dst_info.data_width); if (desc->lli_len < 0) {