From patchwork Fri Oct 20 15:16:23 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: 10020513 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 25A7D60211 for ; Fri, 20 Oct 2017 15:17:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2912B28EBD for ; Fri, 20 Oct 2017 15:17:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1AECC28EEF; Fri, 20 Oct 2017 15:17:12 +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 B697628EBD for ; Fri, 20 Oct 2017 15:17:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751721AbdJTPRK (ORCPT ); Fri, 20 Oct 2017 11:17:10 -0400 Received: from mout.web.de ([217.72.192.78]:49987 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751623AbdJTPRJ (ORCPT ); Fri, 20 Oct 2017 11:17:09 -0400 Received: from [192.168.1.2] ([77.181.73.162]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MMVu6-1e8J7u3jMk-008GgU; Fri, 20 Oct 2017 17:16:25 +0200 Subject: [PATCH 1/2] ARM: OMAP3: Use common error handling code in omap3xxx_hwmod_init() From: SF Markus Elfring To: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Paul Walmsley , Russell King , Tony Lindgren Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <44cbf405-a2ef-0965-00df-c8d4a5aa6950@users.sourceforge.net> Date: Fri, 20 Oct 2017 17:16:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:BpbbCyYEridx1AsLWWdN+SUGQCNnBNT9TXcAURmNw1GBLwe2665 MypKW9OXDMS7P0FCcanm6rckBRSDh3jzV3awFY+/tbBWEYD43iIEbsWic9YlPSiAVPNbTAE OiplLBIAqf/tnRFP4EuNOuNWRsG7TgqfLMjhGLsJClQeGbFg+L+Q1Rx40v6SKiR+IRWtoPq 3Km0eJBfxqM+BxlotBMpA== X-UI-Out-Filterresults: notjunk:1; V01:K0:iAU9ypiZbHc=:h7xeeykkc2KktEs9CqWQ+2 0+1Lb63LMqoEEWQFSHLp9lzhrY/E/o5BgLgz7FFJpSjtwpaYKVbmy7r2bUaa6Rj7PFCuQurTn mhXMo2TKpaDdYis0mV8GZGsR21kJ25ZRRr/1EY+xMxrnY9i5anTdbiFchMgd9mvKzOyWs68vF PWNBKb1376u7qLZdL0apS3Hc7YKnc04akQAZQDNC4UX5c5CU//ebZ/9cI2DSzcfrUy0duJvCv JYI3wF/C9TacCY6q7Y2LkAyB9RVQiLe/Zezl8YAVecgtwjGVOOlPDqWbS49WVia8M4IE4EOCV Abw2Pd6nQ7xiFpe4/Dd9PXoVPQzF9zZoV2ZE9cY6eli0zr7jKzjy6Mi3ci8IFUmWHuMPwnYAH 60f2Uos8yeTrIeoI4uoVgfGk5iGfiCNJUCL301Vj2nJ/3h9TOcMRm/sms+jG/KDXq3Ce5Ob0m bW6vlrUNi4/zl/mCJhEeLxSbJ4xyiu9tqWdiZMoJGVwZf2C+dZK1ukZ0BxIlitAXEDEcoqsuV e5YeYZ3Zvw022CYRMgwpavdYTkL0lSOCd+hOpulrKdM4DTAm8yCGsSgehwNXWD+PgJn1EFj6R b8E5YRNo9B5Qi6XFEKYFG/+WDxgwxx5mYMtWgar/upQtMwthH3YsSQKqyDT4pY3SaPqd8HWG6 ipgU+oyo3mG03w+88+PNf3BB89z8X6pjP4NtyhEvBXW8xdS/MP3Qjpdjtt/7tzvjyv5K7cZix NoToZ39Y3bLoaVKJu+SDZ9oTMjiA6TTwmzKxUs/6BdYOqUhTadBdLdzx1rMCEz+GN6/5D0dKC JYBUujxFS/dJRwXsUI8nEHXYfKgH7VIpxMuIpsJ/OCZ2J1QUJY= Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Fri, 20 Oct 2017 16:30:23 +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 --- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c index c3276436b0ae..bb6eb1efb1b7 100644 --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c @@ -3208,18 +3208,14 @@ int __init omap3xxx_hwmod_init(void) if (h_sham && omap3xxx_hwmod_is_hs_ip_block_usable(bus, "sham")) { r = omap_hwmod_register_links(h_sham); - if (r < 0) { - of_node_put(bus); - return r; - } + if (r < 0) + goto put_node; } if (h_aes && omap3xxx_hwmod_is_hs_ip_block_usable(bus, "aes")) { r = omap_hwmod_register_links(h_aes); - if (r < 0) { - of_node_put(bus); - return r; - } + if (r < 0) + goto put_node; } of_node_put(bus); @@ -3270,4 +3266,8 @@ int __init omap3xxx_hwmod_init(void) r = omap_hwmod_register_links(omap3xxx_dss_hwmod_ocp_ifs); return r; + +put_node: + of_node_put(bus); + return r; }