From patchwork Sat Jul 16 05:30:33 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: 9233005 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 429376075E for ; Sat, 16 Jul 2016 05:31:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 331D222380 for ; Sat, 16 Jul 2016 05:31:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 279122522B; Sat, 16 Jul 2016 05:31:02 +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 A475122380 for ; Sat, 16 Jul 2016 05:31:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8B22A6E0DE; Sat, 16 Jul 2016 05:30:55 +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.15.3]) by gabe.freedesktop.org (Postfix) with ESMTPS id 88A886E0DE for ; Sat, 16 Jul 2016 05:30:52 +0000 (UTC) Received: from [192.168.1.2] ([77.182.189.163]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0MeSLv-1bjPyf1Wal-00QFuR; Sat, 16 Jul 2016 07:30:42 +0200 Subject: [PATCH] drm/tegra: Delete an unnecessary check before the function call "vunmap" To: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org, =?UTF-8?Q?Terje_Bergstr=c3=b6m?= , Thierry Reding , Stephen Warren , David Airlie , Alexandre Courbot 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> <54D335FA.6020101@users.sourceforge.net> <559D6E90.1040005@users.sourceforge.net> From: SF Markus Elfring Message-ID: Date: Sat, 16 Jul 2016 07:30:33 +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: X-Provags-ID: V03:K0:UyX9T8vDTlqrJDf3PiNSBzo4qrdWtK/m9cpreNGBGXbuv0L5CJX 07R8MqgdJFXf68Q2lgvjnCSwaWy5nD4dt5m5bxTa6sD0EGgJZubNSNOcWcBaypI2NAeqMPl D40TY+pfUf3UBA9N5lIZ6vzl59I5H695J3F7HLKxj3bPiwdpQl15OlEgaIuOAXxN4ad+/Lw 6PT8t7sk7nL6pPVan+Ksw== X-UI-Out-Filterresults: notjunk:1; V01:K0:fbJI2lxTa68=:e8NOQ5rGM+Hj+cDToMk3Xa jNY0cvN9nS0UutUvWC+V1oWpY2teFibmM2GGxGx9ontp7QXn89wK4jxIAd+DMMOJQjQFQtN8g XSjqvUtwPUABGm/nN96JC9fdVzYsvilzypwymYaHQL2Uz5J5+rlRk3yZfWTOQAQ81BTgf9xmG eGDgaIYrH//B7zdLMZTxSx0yuhquE+ygzk3gq6gpkrAtvirj/kLeap3X+JVUvvUCBhujIZ4dE Dj6iCDG/caS3aTYVFDS1E1cGqpXDFxs6qnqqUvsNKTBuaXlM8n7ieT4ecUd9BhWHKanAuMbpN XI3pwM+YXSuOz9X6DyGxW4F31ZdA/Opsr4ZQxW5pgPOY4gkLM0rWee2zo9uaYp3SJ4jSa5OAa g84fONRRgZalFjaA8kXe9bTHl1Y9XuCNH54+c4WFPeRczXwmwsF2uOImnYaJsS3Og9UfUNm4t V5UMZG8E/DItv2po9xHDkgQ0sCQnQHAPCG8gTmvBIt5ckYmiNiLVDvMq8TM+Xbee8dPI2zJWu OHWvV/BCa5BFTsrDs2jNBxftJkyZy/s1HA/sNaQ8+kMSc3TvrhhRgMkOpQKyHSiTpU+4uEh1J 1MPsmwIPtp9ab7UkhcsdtgLlOaVPBYSAoYQbuJgJTwMXYInQqrIlnYwdvEDhxar9DyfFFst6P ulS9awvO6yTgly46NjxG5GeM+ONLn3ZgHiO2sOd1XKkI5VJ78ZR1vpf7e6sv8daeG046IFcgV xaFhjPrbi5sIsWIpQCLv+KdAXjs5K0+VYcLt3qAned+qHC18sg6Yc035lhVKCK91QKIPnUHdO sPORS37 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: Sat, 16 Jul 2016 07:23:42 +0200 The vunmap() function performs also input parameter validation. 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/tegra/fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tegra/fb.c b/drivers/gpu/drm/tegra/fb.c index 1b12aa7..e6d71fa 100644 --- a/drivers/gpu/drm/tegra/fb.c +++ b/drivers/gpu/drm/tegra/fb.c @@ -68,7 +68,7 @@ static void tegra_fb_destroy(struct drm_framebuffer *framebuffer) struct tegra_bo *bo = fb->planes[i]; if (bo) { - if (bo->pages && bo->vaddr) + if (bo->pages) vunmap(bo->vaddr); drm_gem_object_unreference_unlocked(&bo->gem);