From patchwork Sat Jul 16 06:40:29 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: 9233017 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 941976075D for ; Sat, 16 Jul 2016 06:40:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 798372521F for ; Sat, 16 Jul 2016 06:40:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D8DA2522B; Sat, 16 Jul 2016 06:40:49 +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 087052521F for ; Sat, 16 Jul 2016 06:40:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 73F136E0E0; Sat, 16 Jul 2016 06:40:42 +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.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id AC0836E0E0 for ; Sat, 16 Jul 2016 06:40:39 +0000 (UTC) Received: from [192.168.1.2] ([77.182.189.163]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0MHuv7-1bMwMm3r5R-003aJn; Sat, 16 Jul 2016 08:40:34 +0200 Subject: [PATCH] drm/cirrus: Delete an unnecessary check before drm_gem_object_unreference_unlocked() To: dri-devel@lists.freedesktop.org, David Airlie 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> From: SF Markus Elfring Message-ID: Date: Sat, 16 Jul 2016 08:40:29 +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:bV/ZAPjNi3tScjzQTrqVPrp91nmimzU+q66OIUpk7mB2BvaN7Lk cebjifcZFSW9MT6K4Tj9BgL/HXQsjh3rKkSey3YXauukDv4XFf2P5w02BVe9OOGaL2FcA9H a9FEahhXVaGayaB8Lt4+EKm0/Q/MjpHaFY4DXv/TyJ5Cy+A474mmjNfNaAwYvzzlKKu/X3q 4eUFcU0pKdF9bomrOfL8A== X-UI-Out-Filterresults: notjunk:1; V01:K0:QDBjcKpuBH8=:EDK2j7ewxWVIVPjQg/+N5y yel0vnNqjXPQglq+1yR1j1LLkOikg8vQFS0a4ZUSuI1mV8zn3DVCpBYJMgq0pBGB8xofeQc/d R6cd7c4lp+l1Ghj1t0jKYE6s9n1lYHU4276j6sSjax/b9YEl3Zg8k43xd/keYPMjsm0uYoKc/ lXDQGE7zvnbpzPI+BM0reDnb19rHV4LwxRdgJD57Wcn4mPO5UNEFjlMaV50vwd5xqB63JtDy4 yW3w7N34Dj7Pkw4idqRjEcoDorSS78rB7/lohPMDT2hvfL2ZlIRJkvsM7C27NcVq5yey4n4ko oQNyMrwnVLVAkd1IQJLrrCViSMSywFvV1sLPUWLyYT+KlsUlFNTq065ZY+6wF18YAI1Soo3dx xxKPscU5MI2FPQN/ZaZ+zUt7PWqehz3WGZxn5P347SvjBV9DBrTmBtAmz4QiNcNpseK2kknu0 WGPRi7nQnTT1aG06+g/luymuEeXyHxHcWpwHy7f8bAyMBQ/XMbsLi69hx0PIUra9KAeXJ1qA1 weH6xMJD7TdXrPwpYtDHey1reVPEvmSg+ctraA53tSY62GfZ4pcg5ourdJKZAEgwYHwpHut90 ZDReRuRDunDP0DplHUUOclz3qxi/gHpWDZlE82hdDtiLrNB9yYvROoyt7BEB0SwwfwAGQrpcS ON6Ag30kzuwbOBzdGZ5jwYfPgha65bDAjOrr3Hsu+wonDweHwH6AT9tHibhDbgQfJxf5njYKc no/OmDuIft8EPToA2dFodx4DHgAwZ+dUga+YUwrGBeRM3tn12a2K0uOfzdnmQlwY2sjpZ2aWb 3zBEWaN 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 08:28:13 +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/cirrus/cirrus_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/cirrus/cirrus_main.c b/drivers/gpu/drm/cirrus/cirrus_main.c index 32d32c5..80446e2 100644 --- a/drivers/gpu/drm/cirrus/cirrus_main.c +++ b/drivers/gpu/drm/cirrus/cirrus_main.c @@ -17,8 +17,8 @@ static void cirrus_user_framebuffer_destroy(struct drm_framebuffer *fb) { struct cirrus_framebuffer *cirrus_fb = to_cirrus_framebuffer(fb); - if (cirrus_fb->obj) - drm_gem_object_unreference_unlocked(cirrus_fb->obj); + + drm_gem_object_unreference_unlocked(cirrus_fb->obj); drm_framebuffer_cleanup(fb); kfree(fb); }