From patchwork Thu Feb 5 09:20:58 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: 5787981 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 312BE9F38E for ; Fri, 6 Feb 2015 02:06:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 66E7620221 for ; Fri, 6 Feb 2015 02:06:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2540920222 for ; Fri, 6 Feb 2015 02:06:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0FC68720B3; Thu, 5 Feb 2015 18:06:34 -0800 (PST) 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 ESMTP id AAC8C6E796 for ; Thu, 5 Feb 2015 01:21:12 -0800 (PST) Received: from [192.168.1.2] ([92.228.134.1]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0M1o86-1XUMlE1KZ8-00tnDk; Thu, 05 Feb 2015 10:21:06 +0100 Message-ID: <54D335FA.6020101@users.sourceforge.net> Date: Thu, 05 Feb 2015 10:20:58 +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: Alexandre Courbot , David Airlie , Stephen Warren , =?windows-1252?Q?Terje_Bergstr=F6m?= , Thierry Reding , dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org Subject: [PATCH] GPU-DRM-Tegra: Delete an unnecessary check before the function call "vunmap" 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:qvnruCnA16ZTZ0czuJx2c76trLwaxDyNq28WOBNDLFUzQCiYnc3 usk1Od28se0rMx9oJj/Qf6Ga3F5wO1z5KvJpeReZmWWSiWBlrKZv/89KB3ziJcHrZ67j/Hw q2HVNWYYXS0WT4fOsfUzcRJcrvxZexfefwwj43YrsNOHgFvOVTm8GgeOxf4bUDR0NE+45+x j1mU8BLoy4QP+CWZNpooQ== X-UI-Out-Filterresults: notjunk:1; X-Mailman-Approved-At: Thu, 05 Feb 2015 18:06:29 -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: Thu, 5 Feb 2015 10:12:51 +0100 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 Acked-by: Alexandre Courbot --- 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 e9c715d..803598e 100644 --- a/drivers/gpu/drm/tegra/fb.c +++ b/drivers/gpu/drm/tegra/fb.c @@ -66,7 +66,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);