From patchwork Sun Jul 5 20:50:19 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: 6719041 Return-Path: X-Original-To: patchwork-dri-devel@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 483479F52D for ; Mon, 6 Jul 2015 01:20:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8429F20656 for ; Mon, 6 Jul 2015 01:20:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 939ED2063F for ; Mon, 6 Jul 2015 01:20:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 63C556E4BD; Sun, 5 Jul 2015 18:20:55 -0700 (PDT) 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.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id DF3488931F for ; Sun, 5 Jul 2015 13:50:33 -0700 (PDT) Received: from [192.168.1.2] ([78.49.236.106]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0LshKH-1Z0XFk1igL-012KhI; Sun, 05 Jul 2015 22:50:21 +0200 Message-ID: <5599988B.2010301@users.sourceforge.net> Date: Sun, 05 Jul 2015 22:50:19 +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: David Airlie , Philipp Zabel , dri-devel@lists.freedesktop.org Subject: [PATCH] GPU-DRM-IMX: Delete an unnecessary check before drm_fbdev_cma_restore_mode() 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> In-Reply-To: <5317A59D.4@users.sourceforge.net> X-Provags-ID: V03:K0:8gP8YM2qdc93RmKAWDVWekJIJ7328Ke//5nr+VdwFKGZlu0Hv86 IHK8q/YQTIvidoqnP9oRMWiye4qgjTyeJS5Zw5jTGJ41jmSMDV/fprJdIGJBq83LfMPCHNa wHeP2jt4weCFPZ1yao7zP8Gtjze202H6cgdB+hd6pYC4m4ZmkjcLZ9F88tpqUGfmx68Eo2S VtTJwgKxwddPvIlr+39Lg== X-UI-Out-Filterresults: notjunk:1; V01:K0:czbZZDJD8ow=:yUscmX3A3cdzWuT2p6Q36I Cq4JmyaEdkRsfFcbwhRcO1CtUOwhKBW5xYBJD+tPmswLMGcgnEurz5M0+iCP9bYD+pZXYmSJF BnibHVhsSXuBWt7vBZ7+2mDH9vkyJd/qO/BPyr6CAjc+I5x/E3PjtbqgSmyPA8jxPCjrFpUOa DOdcfVAxp/pLAEQ28R60ZtE2LAiwFjARerfcLJMp4WGe0VHOm+NyLmLhqzGZa8Sw5dhQ97Nv8 zByWhCZKqjClbzfv4oxogwm7uWDK7oTFne2P2Oe1yhMq2A5men9rARhupRuwvEz382QhG3YrJ uEiSIladM+lzLkMEQ44U9FN258eRmQnpNeGKb5NPK6IbQ9qpfudS+OBiAIW0VdDX7ibjIL8MX g6aWtHL93kpOyra6Q1Zm6lq9lLZ1cKRR6Pm7rp+yEV8pk4UCXfhSeidp6xKYPMybrMuyeSOVF eRrc+Uz45Q10pgsaybcRYgPeMmEvMDrL4tUKLtee0AwhXriDv2ULqLDPiktrcYa/Wj2603Lnp NPswC400ZCVfu3HcC53tHza9SF20vQU4Uls92uLw7KAZlJaGNhBL4tbzylTEWTa7CU83h8+IX nz2XY3PLkJJi2Ms004gtaNan6Z2vTKrFtxnsUDWuqzweLCX4A0FxdAO2Iy8GN8dnvhkh52bTh GVQKXFOJjkTRY01vXlQcH8tU3aNoR5MA4vBNc6my9Lg074vGpDxVAdOVs6Qb4sA9Rsa4= X-Mailman-Approved-At: Sun, 05 Jul 2015 18:20:52 -0700 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.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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: Sun, 5 Jul 2015 22:45:23 +0200 The drm_fbdev_cma_restore_mode() 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/imx/imx-drm-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c index 74f505b..9172c0e 100644 --- a/drivers/gpu/drm/imx/imx-drm-core.c +++ b/drivers/gpu/drm/imx/imx-drm-core.c @@ -63,8 +63,7 @@ static void imx_drm_driver_lastclose(struct drm_device *drm) #if IS_ENABLED(CONFIG_DRM_IMX_FB_HELPER) struct imx_drm_device *imxdrm = drm->dev_private; - if (imxdrm->fbhelper) - drm_fbdev_cma_restore_mode(imxdrm->fbhelper); + drm_fbdev_cma_restore_mode(imxdrm->fbhelper); #endif }