From patchwork Sun Jul 24 07:35:56 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: 9244829 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 BEB0360757 for ; Sun, 24 Jul 2016 07:36:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B39E0269B2 for ; Sun, 24 Jul 2016 07:36:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A7EA327BF8; Sun, 24 Jul 2016 07:36:40 +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 52F99269B2 for ; Sun, 24 Jul 2016 07:36:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751657AbcGXHgT (ORCPT ); Sun, 24 Jul 2016 03:36:19 -0400 Received: from mout.web.de ([212.227.15.14]:52498 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751502AbcGXHgR (ORCPT ); Sun, 24 Jul 2016 03:36:17 -0400 Received: from [192.168.1.2] ([78.48.64.218]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0LclHj-1b0e6B2XsV-00k6jB; Sun, 24 Jul 2016 09:36:08 +0200 Subject: [PATCH] Input-rmi_bus: Delete an unnecessary check before the function call "of_node_put" To: linux-input@vger.kernel.org, Andrew Duggan , Christopher Heiny , Dmitry Torokhov 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> From: SF Markus Elfring Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall Message-ID: Date: Sun, 24 Jul 2016 09:35:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: <5317A59D.4@users.sourceforge.net> X-Provags-ID: V03:K0:Omldh+3uG/2AdcF7VNlTzbM1mMBR8SnYXecd1DZmLK4G7kBNhA0 L3Z6iNwWoAp7j49SFZVX+uYfq8QUdQpSgP7ya7FQbbQ6QRCYLGUEpqxpXpZplsPdPpWDAvw Iwp2dSLRHCYQ2F7ODmiZCZvG4pwi3bsCNF/8sfquxYVK1ok1RQ2OcVDP8DOX/cmV1md+Nv6 vPLkXm7mqzEGbHB3s6nug== X-UI-Out-Filterresults: notjunk:1; V01:K0:Gd3xl5yNqUc=:w3snC7TW4zYeWOFLBk/mp/ 1nTf9/vjdqX8PCz0LdPmODnokR6dE8UV6catF2b6rZm9Ax6TE920NS55JxUa2tEsdnRgVErfQ DpUnN5UyZhF7eTePn9d6XeXhNQBNJ+BCGvOemts7kFuIV1G+w2+sDjIyJbA7MpHi6jBNGy6s/ y2ZhR6X/KVsdq7ke1ELitZx9/AX13+aIs5716UgSV8fWZVVkcOl6CaAku1Y6NNvDFH82DkpsV 4IO8zmvwiVLNfLBt+hbsVbo2C6wkyb3XG0SGLTCHCtoz23V07votwmxtfVSxP0GsMN/JMgH8X LxThkobWAv560+vgzkjXaRbX2CD77EDuStI3CIZtDUuQZGEsUIbEwOPF3HjCP+VXF9wsD5MfV UHXVVsfDYkS1vem6/sIPOWpZpqb0O2cVa9GlpxJMWam2pnSjVcyiAqgR0Z6vJVY2y6mA1INZx meY7yv+ohpCOvs6QfWxvGsztfXaYFuqnsk8MXwRL6JlRIZlzVKQnmDJBw7Eij0xDeY3/sq2Tu D10bh/GCKTSRxJJDrVITV3c3WwkpCapJV4D7e63kNhT0zq1HPNhSL3DpW++8r9usGNSb6l6sc sKYxhUUKXWcStb6ZtAs7DtL0tUrhZH1MfifDVJB+YidH6Fua8CqBG3JKVcjaQhzF302wa6P7k 9q/S1D3Eo7a36FS8QqWYjcqlqna5ZGlK6wsttAxZK046iiFksTEPYK0i55Wr9gGgzbXsy6DJB iksE92d/lsJwNjR456ulvH4k7FBKla6pSQWctkQiJANDriRTy2c7oPCSSDjoGOyahxlirgRtT dWAI8NO Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sun, 24 Jul 2016 07:37:23 +0200 The of_node_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/input/rmi4/rmi_bus.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/input/rmi4/rmi_bus.c b/drivers/input/rmi4/rmi_bus.c index 253df96..a735806 100644 --- a/drivers/input/rmi4/rmi_bus.c +++ b/drivers/input/rmi4/rmi_bus.c @@ -232,10 +232,7 @@ err_put_device: void rmi_unregister_function(struct rmi_function *fn) { device_del(&fn->dev); - - if (fn->dev.of_node) - of_node_put(fn->dev.of_node); - + of_node_put(fn->dev.of_node); put_device(&fn->dev); }