From patchwork Tue Jul 12 20:22:13 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: 9226209 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 077D560868 for ; Tue, 12 Jul 2016 20:28:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF611265F9 for ; Tue, 12 Jul 2016 20:28:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E451427D85; Tue, 12 Jul 2016 20:28:27 +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 A47D2265F9 for ; Tue, 12 Jul 2016 20:28:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F0F5B6E234; Tue, 12 Jul 2016 20:28:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 351 seconds by postgrey-1.35 at gabe; Tue, 12 Jul 2016 20:28:23 UTC Received: from mout.web.de (mout.web.de [212.227.15.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id D12786E264 for ; Tue, 12 Jul 2016 20:28:23 +0000 (UTC) Received: from [192.168.1.2] ([78.53.54.250]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0MbMg8-1bdV9Y2wxY-00ImWn; Tue, 12 Jul 2016 22:22:24 +0200 Subject: [PATCH] GPU-DRM-Radeon: Delete an unnecessary check before drm_gem_object_unreference_unlocked() 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> To: Alex Deucher , =?UTF-8?Q?Christian_K=c3=b6nig?= , David Airlie , dri-devel@lists.freedesktop.org From: SF Markus Elfring Message-ID: Date: Tue, 12 Jul 2016 22:22:13 +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: <5317A59D.4@users.sourceforge.net> X-Provags-ID: V03:K0:aSYUCRQFHu4deAmkDgtUlNleJVGtHGTrds76jBBfkTSikiR8OzX 1hAG03fBlVHghrwdYV36nB2ERuOu9vBlKAjo5QC/lFj4BR0MkiLwW+Mr6TImi5hGfXtLfIU HBZAx9r0PGNhrgjp9v292+tF0TUIny+q4vM48D6JaZ9w2j5ylEIriQ3G/PUuvo6egOVPtVb +nHKxqtVlHCGzATOzioMw== X-UI-Out-Filterresults: notjunk:1; V01:K0:Y8cYphxR98c=:eB0BMZ40WIn/8JVlXVfML1 g8Sk1cB647bbVo5ruFlnkHnZ6fOPj3F09fJE2zbTdbJ+3m1eVyVS9MEYKXpMowGdTnw7pLnvC yQ1d/YdU53MftmD8D2IqK9DoQ2V//G3aGRj3RYkdoHH48W6ydX4swlR71Kl2gTW4brS33sPNc kZGQACvkMh0+ClT6J3Dxu3DO0p7EzEVQEeyCdSolmI1DZThDF61yBoclJpARKu11cvM82Zo4M 134L7x44yUt8t0j8oogbczOqpMdEgOgOITcfCMKyXHUnaC+WXzDOEm4ahg2VYq7q3htD7ChJ1 Bov5ygFhXpcUGlusFFH6R5+l+B4UrncBquNLupk3PzvsWIq0EWN1se71UzfNQhXXimaBFurX1 0CefhPJwaryB7I/j0yRTZbtdKW3MPlnEhrBOVJjHSuSUq21sgxBalays2K7Z/rMDgQ90+OS1c WRc6VQvUO7Kz7cNcd+1DqinnDCONP5AvHPgpCXUget2Hd6+jJbh7YSuulxHA/6OeeJ/1Qx1Hf rXBvN6wXYdEzi87TjExfMDl9yOZNztbCmMOTPxxaGKmBrIoJ8PfRgrmBg3LosjQ/swWvuu7Ie YURTkbER65chKP3J08A1U/z7aBCnIuWyWbhwejtegkkwHOEbaITmZxLlTe/wxUBSg93Rcm+JS Yeh4AGWYEPv9psRg7apnZapN6ZeyJWCqWmU96eR0MTyD+qaigHpYJexs67vLuSlyl4/PQgBmA sRZWVJrO2lUsriLUOyb9DPE2TuDQB+VfbJcvVcNom+q2XPtsGpa2F4fvGkYuzm5QgpBRJ6xvk 5PvQbYu 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: Tue, 12 Jul 2016 22:00:55 +0200 The drm_gem_object_unreference_unlocked() 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/radeon/radeon_display.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index 5f1cd69..1efab5f 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -1324,9 +1324,7 @@ static void radeon_user_framebuffer_destroy(struct drm_framebuffer *fb) { struct radeon_framebuffer *radeon_fb = to_radeon_framebuffer(fb); - if (radeon_fb->obj) { - drm_gem_object_unreference_unlocked(radeon_fb->obj); - } + drm_gem_object_unreference_unlocked(radeon_fb->obj); drm_framebuffer_cleanup(fb); kfree(radeon_fb); }