From patchwork Wed Feb 4 21:00:32 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: 5780481 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 DF87CBF440 for ; Thu, 5 Feb 2015 00:46:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2B839202C8 for ; Thu, 5 Feb 2015 00:46:40 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 56C2820279 for ; Thu, 5 Feb 2015 00:46:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5CF0A6E734; Wed, 4 Feb 2015 16:46:33 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 325 seconds by postgrey-1.34 at gabe; Wed, 04 Feb 2015 13:06:41 PST Received: from mout.web.de (mout.web.de [212.227.15.4]) by gabe.freedesktop.org (Postfix) with ESMTP id 3DC016E705 for ; Wed, 4 Feb 2015 13:06:41 -0800 (PST) Received: from [192.168.1.2] ([92.228.139.27]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0MQc7J-1YDzIs2kqj-00U5CS; Wed, 04 Feb 2015 22:00:35 +0100 Message-ID: <54D28870.3060400@users.sourceforge.net> Date: Wed, 04 Feb 2015 22:00:32 +0100 From: SF Markus Elfring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: David Airlie , Inki Dae , Jingoo Han , Joonyoung Shim , Kukjin Kim , Kyungmin Park , Seung-Woo Kim , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH] GPU-DRM-Exynos: Delete unnecessary checks before two function calls 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:YTXdp7GHloWtSyQdVZUrTrU0otycLpaNhT28xTYYd2Wo6gJZU+a 21nbD3UaFNonLbEtvzSGg4xheT8EgAmFl9D8SETmRoJIUkEmfoaoy2tZ2uRUZnFQ66tb4Xa oro4YgcJhAtPPelX4GG29138xbD7wJiZQhQSsvF+itdyiyQ9KkJu/P0OnCOU3/wEakH8EWY rJo0irz8NwDRKUo2BiXYg== X-UI-Out-Filterresults: notjunk:1; X-Mailman-Approved-At: Wed, 04 Feb 2015 16:46:32 -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: Wed, 4 Feb 2015 21:54:45 +0100 The functions phy_power_on() and vunmap() perform also input parameter validation. Thus the test around their calls is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Acked-by: Joonyoung Shim --- drivers/gpu/drm/exynos/exynos_dp_core.c | 6 ++---- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c b/drivers/gpu/drm/exynos/exynos_dp_core.c index 34d46aa..306cf1d 100644 --- a/drivers/gpu/drm/exynos/exynos_dp_core.c +++ b/drivers/gpu/drm/exynos/exynos_dp_core.c @@ -1057,14 +1057,12 @@ static int exynos_dp_create_connector(struct exynos_drm_display *display, static void exynos_dp_phy_init(struct exynos_dp_device *dp) { - if (dp->phy) - phy_power_on(dp->phy); + phy_power_on(dp->phy); } static void exynos_dp_phy_exit(struct exynos_dp_device *dp) { - if (dp->phy) - phy_power_off(dp->phy); + phy_power_off(dp->phy); } static void exynos_dp_poweron(struct exynos_drm_display *display) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index e12ea90..0dd448a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c @@ -313,7 +313,7 @@ static void exynos_drm_fbdev_destroy(struct drm_device *dev, struct exynos_drm_gem_obj *exynos_gem_obj = exynos_fbd->exynos_gem_obj; struct drm_framebuffer *fb; - if (is_drm_iommu_supported(dev) && exynos_gem_obj->buffer->kvaddr) + if (is_drm_iommu_supported(dev)) vunmap(exynos_gem_obj->buffer->kvaddr); /* release drm framebuffer and real buffer */