From patchwork Sun Oct 22 13:05:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10021701 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 A1471603D7 for ; Sun, 22 Oct 2017 13:05:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F9B82876A for ; Sun, 22 Oct 2017 13:05:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 84376287B9; Sun, 22 Oct 2017 13:05:29 +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 41924287A8 for ; Sun, 22 Oct 2017 13:05:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751215AbdJVNF1 (ORCPT ); Sun, 22 Oct 2017 09:05:27 -0400 Received: from mout.web.de ([212.227.17.11]:50279 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751019AbdJVNF0 (ORCPT ); Sun, 22 Oct 2017 09:05:26 -0400 Received: from [192.168.1.2] ([77.182.45.221]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MhDYL-1dtNn52ETZ-00MIuD; Sun, 22 Oct 2017 15:05:10 +0200 To: linux-crypto@vger.kernel.org, linux-samsung-soc@vger.kernel.org, "David S. Miller" , Herbert Xu , Krzysztof Kozlowski , Vladimir Zapolskiy Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Subject: [PATCH] crypto/s5p-sss: Use common error handling code in s5p_aes_probe() Message-ID: <791df15e-3a35-d270-0acf-1661bd89adad@users.sourceforge.net> Date: Sun, 22 Oct 2017 15:05:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Language: en-GB X-Provags-ID: V03:K0:u9azt40Yb8Li7x8DNP+yA5hbHuH1uXdMhauhOJlrFZcj2FLBgqP LOJFk+IereQlz1Ax8Uo9uDJkO+wx2KEXOyGc6/P7cGoiiqQjnUoXZLIp8DcLcoNtWeCkE1d z22m1si38o6YRW5poQ2/d9S2Lh3G+J9KY3xWLdB9J4GKZEQHvheMPX8BYrc+z5cDYVyJdta VelDldBQpxQEtstpAMwGQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:vkzofEXYc08=:cC1GmnPMYaAxj3Rvv2aocc cB5iSBO3oWtHi42oWz3CbftjkgBpaKYH7rulw4LutQ2te+a+cISvjiu3dyo2dFVMRT4HBSwgZ 3SAsIH+pGNsVoj3bypjLjhrD+g/IubBFVJJJp880oQ64GCppj6rvp+JqJP54EykSJ178WHnuU mUcz2pcTZ7qU47Pn61lCBB/DNJdw69eBMfXiBrZvqkI+6H5dwdgFqbodbgvriF9Jcw8SJ12TL e+1aozGApFSrLlDXFLIJW/nhNWXE1TiXops0ZEHnp36Z3SSpazKrlNyLJIFlKu9AtnFAwGkIq 4aghB/r3zJPT2Zs0MLTRe8GywGtFrfwX09Z6QuonzpJjyZUAjLFoE6j3jiSGQ08582bIuPDgv uwGZdh/0maQEoUh+/uenDt8hGrMfU5rXSoe9zTA6A6gDLa2xtmvXKhryu7NizWrtPhWh7/Dvd 3D4/FJ0+YpVnpqj8PbPaS2M43YeNJlKWNtpL7TJR0buLkklTLKQcOOK9p7i/YsQ6A81AO4Qbp Tu2XzKkATxYCFvmq/9Ak+VtlpzZDgBopx53U7yqbOmnI8PpE4WHu0OP8RsPnkneufTdndFr1L ElDz962IIVqVCAMsxUFctAImr/h0bm3O+/9cYYOeWTBvLmR8A8Bg5tEs2LRy0bES+8Hnlk8Ik GSfGHB2gJEEPwnedjkJ0kYh9Vabpuw2QpJ/l/SuXwzc0tjXQgQ5eyVpHmlCTEwnt0QUNx3V+i niOAh7jsX4ScAD2ndrOi81cBbOPkRykC2bUW4N3azp1sp8Vaw/S8u9MpOICkOYvNjtwL8BwiU eF9qJOsG21B3Is0WdlgnAYADzFqM3nymEKAxIlEdtoA4Ovcq54= Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sun, 22 Oct 2017 15:00:27 +0200 Add a jump target so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/crypto/s5p-sss.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c index 7ac657f46d15..ea59e184c199 100644 --- a/drivers/crypto/s5p-sss.c +++ b/drivers/crypto/s5p-sss.c @@ -863,16 +863,13 @@ static int s5p_aes_probe(struct platform_device *pdev) pdata->irq_fc = platform_get_irq(pdev, 0); if (pdata->irq_fc < 0) { err = pdata->irq_fc; - dev_warn(dev, "feed control interrupt is not available.\n"); - goto err_irq; + goto report_failure; } err = devm_request_threaded_irq(dev, pdata->irq_fc, NULL, s5p_aes_interrupt, IRQF_ONESHOT, pdev->name, pdev); - if (err < 0) { - dev_warn(dev, "feed control interrupt is not available.\n"); - goto err_irq; - } + if (err < 0) + goto report_failure; pdata->busy = false; pdata->dev = dev; @@ -906,6 +903,10 @@ static int s5p_aes_probe(struct platform_device *pdev) s5p_dev = NULL; return err; + +report_failure: + dev_warn(dev, "feed control interrupt is not available.\n"); + goto err_irq; } static int s5p_aes_remove(struct platform_device *pdev)