From patchwork Fri Nov 6 12:43:41 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: 7576221 Return-Path: X-Original-To: patchwork-dri-devel@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 0652DC05C6 for ; Sat, 7 Nov 2015 18:38:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 336DE2060B for ; Sat, 7 Nov 2015 18:38:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 358A52053B for ; Sat, 7 Nov 2015 18:38:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 256716E448; Sat, 7 Nov 2015 10:38:17 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 312 seconds by postgrey-1.34 at gabe; Fri, 06 Nov 2015 04:49:06 PST Received: from mout.web.de (mout.web.de [212.227.15.3]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0CFD96EBB4; Fri, 6 Nov 2015 04:49:05 -0800 (PST) Received: from [192.168.1.2] ([78.49.86.198]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0MQvxm-1a0mXG2i7S-00UJnG; Fri, 06 Nov 2015 13:43:44 +0100 Subject: [PATCH] GPU-DRM-i915: Delete an unnecessary check before the function call "pwm_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: Daniel Vetter , David Airlie , Jani Nikula , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org From: SF Markus Elfring Message-ID: <563CA07D.30805@users.sourceforge.net> Date: Fri, 6 Nov 2015 13:43:41 +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:JOmyZJayZClPT4jN6TOrCxZalTGioNg48MbpKKJMJEq4PUKn3Cw HhJjZhyOwWrW9ms2yRlsKhZMGCfopGVVCXYGj8mtMHQ90NDCXj50kfsr6q8t3tzGV8LwQJF bpY17eR31O2xfelklBLEyZhdWrNeRcjXglFigRFrhM14C91lZh3CWZPIj2FGRMnPhi7h8PS qxWiQcez2CmIJMEAP1CRg== X-UI-Out-Filterresults: notjunk:1; V01:K0:SN0VPH3sSTo=:qGXHp6BTOJWhBq1gEZbcde +cC7qndN/c3FgDLNumzIsqoHTDKqsIiKWakhaapgNkCQFlVbW8/wA2L7XyDJL5WgPiMqn9i3C nyUwSbhNuJhK/53mrDGUmKyfCl1Vg5BtNSYIbIDo1w02loRpsPa7qsDvNaqdUcwvKUPEmEX8G 47c0tOPbzkU23t1g5HViUmj/GhZBaUT9RfglkARA7jP9RsqQIxgJMHjcGhm9G8LstekTQhruh JbwthITSJS07xq9KNm/+HfWQOOUW3lg83k3877gOdJBUpSmQBzbEDXPlnKxAJLm3YYoabmxPQ +j7ErvkcSZ3KGTaNB1jjIY0DyAejjAprfgFc4RMD3YyiB+hWoQp4sHqGCLSiEs/mO/QxEVxJG nQbPjdKNx7Q9TASTZkwRsZqYAFL9+vBRQGP1SyAYhrOJXPcqIIYlk7RL3awTwNvkNuWvPAljC ndqvDiIUd+1CnwOjjvU3y22ilKdUbcuFKfy42EGs79pNrzw1u2fKjARR4aoNq3SVpqy73i1Fc U+7GQkoDOklyIczRRH8AM+KD/rbAV/SNTn0SIrl0mQj8KXWdl0+ud9rDYXeCI3cQl/pYwtBeK En+5kroyY9ZERAzBpOGKYSF27HfRh2wVFhzsEIXgqlSerfxr4UBdJ9/MezTL8t6iVMjErGa/S zmFU259JrVS2zqYWPfn6iscALky3y+a0mi28M5P1J0svJs1q1ot/L9whOQuJkvZ5FrExMvcaQ Snq8K2zS/C0rptDXRGYXYPKmLtZEIA8gynIr/PvD/uzUp5aqvaHix+xYxghsWTYvfRDTNuO4p uMez9dx X-Mailman-Approved-At: Sat, 07 Nov 2015 10:38:13 -0800 Cc: Julia Lawall , kernel-janitors@vger.kernel.org, LKML X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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: Fri, 6 Nov 2015 13:38:22 +0100 The pwm_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/gpu/drm/i915/intel_panel.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index a24df35..3d8d913 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -1729,8 +1729,7 @@ void intel_panel_destroy_backlight(struct drm_connector *connector) struct intel_panel *panel = &intel_connector->panel; /* dispose of the pwm */ - if (panel->backlight.pwm) - pwm_put(panel->backlight.pwm); + pwm_put(panel->backlight.pwm); panel->backlight.present = false; }