From patchwork Tue Jun 30 12:10:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 6695431 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2F6479F3A0 for ; Tue, 30 Jun 2015 12:11:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 546F8205F4 for ; Tue, 30 Jun 2015 12:11:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 658A2205CA for ; Tue, 30 Jun 2015 12:11:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752229AbbF3MKp (ORCPT ); Tue, 30 Jun 2015 08:10:45 -0400 Received: from mout.web.de ([212.227.15.3]:57283 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752134AbbF3MKm (ORCPT ); Tue, 30 Jun 2015 08:10:42 -0400 Received: from [192.168.1.2] ([78.48.33.152]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0LqlRS-1YVdfT2oOA-00eJdR; Tue, 30 Jun 2015 14:10:37 +0200 Message-ID: <55928739.5040809@users.sourceforge.net> Date: Tue, 30 Jun 2015 14:10:33 +0200 From: SF Markus Elfring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: =?windows-1252?Q?Beno=EEt_Cousson?= , Paul Walmsley , Russell King , Tony Lindgren , linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org CC: LKML , kernel-janitors@vger.kernel.org, Julia Lawall Subject: [PATCH] ARM: OMAP2: Delete unnecessary checks before three function calls References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <54705EC3.90708@users.sourceforge.net> In-Reply-To: <54705EC3.90708@users.sourceforge.net> X-Provags-ID: V03:K0:bXqPlP/KIZJ3gs8anIaKpGkEp0WZCROvM4DTNKH63SpR3DHe81z p9sH8WYwEAFn5yd8CfFXlxAbkHB3BZzlsGTyNmxlC27058YwRyPmjGBzhcyIlLhgGXgZLV2 2loRK3dU1EgnAqKQ1uOEmfwOozC+yCS6Sp1RrawZnYt4qAreX7xMdVhucSbTM4vLx0mCbpe UB3ys35vp6wNtd7XGOTgA== X-UI-Out-Filterresults: notjunk:1; V01:K0:LK+D10UKB+E=:nSvkHbQSFKga8dosfiJguH Zg5mWQM7yusvJlvxLz1s4f7BM9bXlKNcphEpV5nlnfv9C0dXwRVC/Dkt0FvmaLUsy9FK3j5h9 Hg0BPX6kAan9gwO2HIrlSMqt42K422HBqgAn4jghv3xnIt3F2qV9x+8/OP0wBfnai0x2kb7OT IOhTmDmsJKQ1bUuxsziuNBrlxzNZgp/sVUnozl+wAeK9zwnSWp+Az9drNJ9DbN5IijcgEB7tQ +zsTZO5qBEQm3yT3WJhLd7PI6AorSz6og578dpNSOyhSgdxEw2KHL8JU5f/sH5dCDg/xDfded FRyTqB2Y4ixQD0o9S53niDFBxl4MGTAA7Ruy+JGJUM1Wbjyjk05uS98g9mXjq4QdrtLQhaNEP uToWXGaWDD7XuGTOeNmu3ii3iAKspmca4avBBf8OF9PcxJJm1U3st+6XTTSNiRQu9tZahCJzV SnPJML2AbmIpOMEuAVHbdq5hl0XYtbE7GrTDByP+wCduRjtlXsHW1ct7V71jlTj7OTM0JglDb 7rWm/2kWYv1W8ZAlxpPlyl1HdbrfOOHCYMvHX46HCeajTBFFNzZTWRahsGn424gSCTCUE202R YdF+m/O6jgg9yoMRr7At7EZdDM+vbY+iqmEhzdAxqY9xD7IpzQ+z9UNL0uBltVmOLEdz6nr50 u86XaTG+DTN125t31r6j+3WfJt/X6FREsUNzcxUaezlhdaCs4JC/1IPbLu+eFlPYy8XU= Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Tue, 30 Jun 2015 14:00:16 +0200 The functions clk_disable(), of_node_put() and omap_device_delete() test whether their argument is NULL and then return immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- arch/arm/mach-omap2/omap_device.c | 3 +-- arch/arm/mach-omap2/omap_hwmod.c | 5 +---- arch/arm/mach-omap2/timer.c | 3 +-- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c index 4cb8fd9..196366e 100644 --- a/arch/arm/mach-omap2/omap_device.c +++ b/arch/arm/mach-omap2/omap_device.c @@ -193,8 +193,7 @@ static int _omap_device_notifier_call(struct notifier_block *nb, switch (event) { case BUS_NOTIFY_DEL_DEVICE: - if (pdev->archdata.od) - omap_device_delete(pdev->archdata.od); + omap_device_delete(pdev->archdata.od); break; case BUS_NOTIFY_ADD_DEVICE: if (pdev->dev.of_node) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index d78c12e..1091ee7 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -921,10 +921,7 @@ static int _disable_clocks(struct omap_hwmod *oh) int i = 0; pr_debug("omap_hwmod: %s: disabling clocks\n", oh->name); - - if (oh->_clk) - clk_disable(oh->_clk); - + clk_disable(oh->_clk); p = oh->slave_ports.next; while (i < oh->slaves_cnt) { diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index cac46d8..15448221 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c @@ -208,8 +208,7 @@ static void __init omap_dmtimer_init(void) /* If we are a secure device, remove any secure timer nodes */ if ((omap_type() != OMAP2_DEVICE_TYPE_GP)) { np = omap_get_timer_dt(omap_timer_match, "ti,timer-secure"); - if (np) - of_node_put(np); + of_node_put(np); } }