From patchwork Sat Sep 17 15:23:15 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: 9337203 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 78A3A6077F for ; Sat, 17 Sep 2016 15:23:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6919A28CDF for ; Sat, 17 Sep 2016 15:23:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5DE8A28CE1; Sat, 17 Sep 2016 15:23:50 +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 052B228CDF for ; Sat, 17 Sep 2016 15:23:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752648AbcIQPXt (ORCPT ); Sat, 17 Sep 2016 11:23:49 -0400 Received: from mout.web.de ([217.72.192.78]:54570 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752409AbcIQPXs (ORCPT ); Sat, 17 Sep 2016 11:23:48 -0400 Received: from [192.168.1.2] ([78.48.101.40]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0MfqEy-1bO5k91ADE-00N71B; Sat, 17 Sep 2016 17:23:17 +0200 Subject: [PATCH 14/24] ste_dma40: One check less in d40_prep_sg() after error detection 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: <26e8b766-a614-ba4f-7f16-f3a89ed714e4@users.sourceforge.net> Date: Sat, 17 Sep 2016 17:23:15 +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:IVS1yUmETEv9gPuwLHT1mOI0QAKNp5WWD6EJ3yPf5FpWh6FMBSS 3Jr54gsxbcQRWR61GLidIGiRCLk8s9hrtsdtfVhzVzyamjXOJzHkumPdQYWi9Q1YAzf+IF1 3yrpPE2zVAvAOFlUzHo4h8AzEVBwXlLNUBDanY1eXFsVGIkA6B+l9QWWaylHnGmmxWvC7Qs LccZrSGX81UDQMHcac7cA== X-UI-Out-Filterresults: notjunk:1; V01:K0:I07+PMGCqFg=:qgcg3ezcbUJInm0oRt12iW 9Vw4tesmyCMnDLHtZ+pAW6/rUI33eD1cC0lUT1qjqGfMNdFCRa6PTWiwVsr2wJsiD8CNAcb3n mhHQEkBThbLJ7xAgS6sWx8MdJ8cBidyLbSyrRqY9/jmYNFq9QRQMpD6MwGQSHoQ+T9i2a2RHQ aYZaokvGuz/wjqQ3RJl4Z7m6WKt9h3L4FSZi/34TWRqw0H748Y/LlFZxVn8nTXGzKhphgwHKk ViEsS+dFCg7zN0jEcw9Id8QjwwLHR+jkZ2t2xKWz31hE43k+2JfaA223uqs066rO9ke1ewKyB pkYjaVe9+k0lUD9+kUcxDHtwNe0O9rR91OZg0ht0AuPgUJ11dV7cO1GMFH+uBcnaqdNFtby+H 1aYUMDw1bA0dGJYt4NtESiqQgw9HeQsDISl2lpyXdjvCgwimJ7AL0sya8wR4SOgTeAR97rnOe pbMkgpTshqUXKVfpa0N9Ezwe+XK3/EuLLVQA+EwpSWIYZNzgyhvhOPBkqWbZWKzdv6ehDxeov VJYM/3BZq5qSLGbhv9AhXt/fQbnRcg567yACXxO7YjZwXrMBlxr/jFa7/Gp1N585J0M8tp/9a RIYwmmH4N0unPi1ki3gcxQ9xaGrintSQ8okgffST+IlIXhUcoulOCA955if7PKuRWmWumVL9a 894OxnMclzI35cLznFyMKsHlt2ivfCw/e8oMdEXZ1p1gPvGeLZ6Dt0pym36pNAZPHEz37/KyQ cNxInWLfdZ/CdnaCu3ORBNL9gI6ApDMyFiD5cdYDDtSMiAf5Rekv8YOlJ602rqRkRYKMjoEAm 9nljRWt 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:34:07 +0200 * Adjust jump targets according to the Linux coding style convention. * Delete a repeated check which became unnecessary with this refactoring. Signed-off-by: Markus Elfring --- drivers/dma/ste_dma40.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 0788add..a7e7cd0 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -2251,7 +2251,7 @@ d40_prep_sg(struct dma_chan *dchan, struct scatterlist *sg_src, desc = d40_prep_desc(chan, sg_src, sg_len, dma_flags); if (desc == NULL) - goto err; + goto unlock; if (sg_next(&sg_src[sg_len - 1]) == sg_src) desc->cyclic = true; @@ -2271,7 +2271,7 @@ d40_prep_sg(struct dma_chan *dchan, struct scatterlist *sg_src, if (ret) { chan_err(chan, "Failed to prepare %s sg job: %d\n", chan_is_logical(chan) ? "log" : "phy", ret); - goto err; + goto free_desc; } /* @@ -2283,10 +2283,9 @@ d40_prep_sg(struct dma_chan *dchan, struct scatterlist *sg_src, spin_unlock_irqrestore(&chan->lock, flags); return &desc->txd; - -err: - if (desc) - d40_desc_free(chan, desc); + free_desc: + d40_desc_free(chan, desc); + unlock: spin_unlock_irqrestore(&chan->lock, flags); return NULL; }