From patchwork Fri Nov 6 17:00:30 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: 7570051 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 57433C05C6 for ; Fri, 6 Nov 2015 17:00:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7D48F20674 for ; Fri, 6 Nov 2015 17:00:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 82E082066C for ; Fri, 6 Nov 2015 17:00:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932340AbbKFRAl (ORCPT ); Fri, 6 Nov 2015 12:00:41 -0500 Received: from mout.web.de ([212.227.15.4]:62633 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932320AbbKFRAk (ORCPT ); Fri, 6 Nov 2015 12:00:40 -0500 Received: from [192.168.1.2] ([78.49.86.198]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0MXpmp-1Zyoqt3ZKh-00WqcE; Fri, 06 Nov 2015 18:00:32 +0100 Subject: [PATCH] HID: Wacom: Delete an unnecessary check before the function call "kobject_put" 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> To: Jiri Kosina , linux-input@vger.kernel.org Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <563CDCAE.9080109@users.sourceforge.net> Date: Fri, 6 Nov 2015 18:00:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <5317A59D.4@users.sourceforge.net> X-Provags-ID: V03:K0:sFYGBurGP6pOZHSuFFNo0DoIba/MF5isM3mjRUOxKfBkQJciSaS zEqPG+lcGsWWvyM9Eg7beoCpLCL7aI4XFOGOweuT1843cjcHsonZXX9pxmTYS05MsJgzzbp ZCM1EwswzNEHBs9aiidbv1ORpx5OEz6cOieANBwCi2IoBkiem1pIL6f/A9deQ7nWS54iBWY QbsiJhWW2lctxA+F7q/GA== X-UI-Out-Filterresults: notjunk:1; V01:K0:tAc1PSNcSlc=:WuV4RpO2XtYmTaPx4joXoR lOY+cRYIVoNK0excy900pzaBHE0mkfF8UxXVuUhXPNzBixa9SIX9dDwVxpwDI8xbl1Dd6hJOn 3JonFOZOdqebUoT4QQFgBOBgxz1eKg+5OD+MKhfgsJCuRp4j6HPyJSVfIhb2rzxOwdtyzc/7X E1iAxAhWd5r3tOsmrWHf37+VPYBck2GyKb5Qonui5ebMinUezRErBPAYFeV0ytEH/i43ilgpw X6XMh3eCoYmUuZBy8HnoNIxmsRosvegDYhRi/tPoRTH/LbsTcK8/qx6/kWDS7Z2O+lOftC+te qsMQxI/rD+nigHto1m0z5jMrX0myrZlK8e6CyeW2MyKVGo+M2/5jSEdoaasFJY2pl6YwIwwko 93rIIPqzfwTUxrTUXAt3lmfz3ZdysiX5ywGOFfQZUm6ONcKVCDdkuTCd/HzGiXmELQMnmIGLn m480AG5gSrXR+bi/fkhhoXLDJ52mYqs6J4/0ohGlqsqa8m43w1kXb1lhGP3li2YBs2xInNqph bhiicr3ad+WzeRpI9VPOMm6BuP/LCU+6pF2i6DWrO3+Qubf0vq2uiKW/3gRj3W0U6RRFZaWCg 0Giq3KiP9YZA31ZykCzwFoNTQ+wh4bbZ4t/iQQJiY94TGtJlA8os5mpS45nPRvw0XN66kCnLX krxDXRHjb689c0Kg0G5fehDdzvjvpm/jeIa53wAcXbiBbzRNmFNNczslbN/7fTkDOJVXTKmsV ETffu3G3mtkssRTPMM/lUOyxOAxAGitsBB4BsMaaAcWWqjjNNOQJhAEW5nZevs7bG/REM10Th Z0tTcUe Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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: Fri, 6 Nov 2015 17:55:23 +0100 The kobject_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/hid/wacom_sys.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index 125e9d5..fb9b1d1 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -1353,8 +1353,7 @@ static void wacom_clean_inputs(struct wacom *wacom) else input_free_device(wacom->wacom_wac.pad_input); } - if (wacom->remote_dir) - kobject_put(wacom->remote_dir); + kobject_put(wacom->remote_dir); wacom->wacom_wac.pen_input = NULL; wacom->wacom_wac.touch_input = NULL; wacom->wacom_wac.pad_input = NULL;