From patchwork Fri Jul 15 19:21:36 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: 9232483 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 75EBC60865 for ; Fri, 15 Jul 2016 19:21:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E62A26D08 for ; Fri, 15 Jul 2016 19:21:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5304F27CCB; Fri, 15 Jul 2016 19:21:57 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B76E27BF9 for ; Fri, 15 Jul 2016 19:21:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 492D56EAA4; Fri, 15 Jul 2016 19:21:53 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.web.de (mout.web.de [212.227.17.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2EC276EAA4 for ; Fri, 15 Jul 2016 19:21:51 +0000 (UTC) Received: from [192.168.1.2] ([77.182.179.66]) by smtp.web.de (mrweb102) with ESMTPSA (Nemesis) id 0Lhev7-1b1wxT1IA5-00mvIv; Fri, 15 Jul 2016 21:21:42 +0200 Subject: [PATCH] drm/vc4: Delete unnecessary checks before two function calls To: David Airlie , Eric Anholt , dri-devel@lists.freedesktop.org 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> <563CC27A.7020804@users.sourceforge.net> From: SF Markus Elfring Message-ID: Date: Fri, 15 Jul 2016 21:21:36 +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: <563CC27A.7020804@users.sourceforge.net> X-Provags-ID: V03:K0:S8Fes1cSDlA3EQZhRDKVC5ZsB7cIqtFWtTvqwbxiP8JlOYgIggW qhnObAuT8Jq9F5rxWdeeCjsK/S1i8EFg4POcA1ltPGxSlo8WaB4ufQamo5bRDMglhhFUWY+ RFHzL9h2cPiHSQ3auXQcvI8F9mg0mtsgfG0dvin811aJqFKf+X0Mt3sI6cpZdl2zETSbqJa fiVBDIQJfcXYemAaOFLtQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:NFiXdX34m+8=:d0wwaXx76XLl1vvPmYu1w0 XHNTTFBTc9eOTxVOBWo6gQTtKRLaoO87NthEKd35cxjDj16RxeVc1mcFFu026YKYeusV5iYhj FeZASmbnvptAHCdLaagKTRsHHu/5tKkb4oefHFoXSZDpFXj21RiFAUMvYnfWV204BocA2Ka+D gtYz5gGCfeeKmn7LxG20d8kq+GkS6aB8Iy2xB+OK0ZIP9wGTR2OpSnCvR002aKfRplR8trnNB BBSOySmiFhqKIJQTzQMhEywPkbS5XB9AdiVMsBCHxUDNmzljPAh1M96ee45lRamaF+W1aZAoq NESgwxXvO0LidRPj4GOv4g94LmMlgy92AIHHiuan/MJ8qkeUXyFp683b+GI1vrJXSS7QErWzn O162rHyobwYFAQlBpq87JlnFWr6faW9NXos4ZnE4MHzgjRi3nljWyli9wSICD5h78hfEA2Jx3 ZUingdqqPPStL4MUpZP6Bfrz1avUSImNiUNNeUz81PjqoZq27FGuhfJDTKgkvZIEnIjYKOeKe Bf/+wRD1brKGkaoJ4g35jeJqdkjR8uxtVVgo4FbmdCpTVGfSeRD0ZDlBQi2ASxKqjgP95Qbx1 3GiUzRm7ujH8MKI0bZU52LWGj6qrqryBoTztSJoWXAgEfCKfOjBLKhfPdmkygux9GcmZD0d0C 3HO7o2SRXI4ljOS4WK7o5op6KfVs7V0rPWPIxKoKOzjbud+DH33R4skKbYROFd6xo4/oQRvjY oje5eCrnDqkHhDXCJtTsncufk6129/LGA59dQKTfRa2ZO4NY7OhfcsLRZ1f603fAgauvWrduO Z9RPU0p 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-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Fri, 15 Jul 2016 21:15:37 +0200 The following functions test whether their argument is NULL and then return immediately. * drm_fbdev_cma_hotplug_event * drm_fbdev_cma_restore_mode Thus the tests around their calls are not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/gpu/drm/vc4/vc4_drv.c | 3 +-- drivers/gpu/drm/vc4/vc4_kms.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index 54d0471..ce74d86 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -47,8 +47,7 @@ static void vc4_lastclose(struct drm_device *dev) { struct vc4_dev *vc4 = to_vc4_dev(dev); - if (vc4->fbdev) - drm_fbdev_cma_restore_mode(vc4->fbdev); + drm_fbdev_cma_restore_mode(vc4->fbdev); } static const struct file_operations vc4_drm_fops = { diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c index 9a217fd..4ac894d 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -26,8 +26,7 @@ static void vc4_output_poll_changed(struct drm_device *dev) { struct vc4_dev *vc4 = to_vc4_dev(dev); - if (vc4->fbdev) - drm_fbdev_cma_hotplug_event(vc4->fbdev); + drm_fbdev_cma_hotplug_event(vc4->fbdev); } struct vc4_commit {