From patchwork Wed Jul 20 16:02:42 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: 9239851 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 2A4866077C for ; Wed, 20 Jul 2016 16:03:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B90427C0F for ; Wed, 20 Jul 2016 16:03:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0FCF327C2C; Wed, 20 Jul 2016 16:03:51 +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 396DC27C0F for ; Wed, 20 Jul 2016 16:03:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 41F766E872; Wed, 20 Jul 2016 16:03:46 +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.4]) by gabe.freedesktop.org (Postfix) with ESMTPS id 798D96E872 for ; Wed, 20 Jul 2016 16:02:55 +0000 (UTC) Received: from [192.168.1.2] ([77.181.180.179]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0LcPRO-1axgfb3CdS-00jmsY; Wed, 20 Jul 2016 18:02:45 +0200 Subject: [PATCH] drm/atomic: Delete an unnecessary check before drm_property_unreference_blob() To: dri-devel@lists.freedesktop.org, Daniel Vetter , David Airlie , Maarten Lankhorst References: <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <55998CD5.3080204@users.sourceforge.net> <20150706065346.GA2156@phenom.ffwll.local> <563C8B3E.405@users.sourceforge.net> <20151116140425.GS16848@phenom.ffwll.local> From: SF Markus Elfring Message-ID: Date: Wed, 20 Jul 2016 18:02:42 +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: <20151116140425.GS16848@phenom.ffwll.local> X-Provags-ID: V03:K0:EsgGPZ6gdI8MqImsK1noBeGlvErNgusW8Lj8KI/fwk2rDGSiZi5 m28J5nIX62uHaJWRr2WGfZUVwWVMp5clT+NOBsh6n10pbBb6LO/YLB/8aEloTDGWxHU0WhA 6/oYYU3bLHO98jOK8iKPbXMH/DAPU818xds3v3jB9JjuM9hBgfRokHtFT6XsuzrP6C+sPzx 99Q40rfZ3mOnL5PqUQHKA== X-UI-Out-Filterresults: notjunk:1; V01:K0:5CaSvnvNsuA=:T1oPWkJKd4ux6MoicU67QP T2h8AfcAFnVqtELAbZaK5GdRkxguHjBBtqLO52EzEVddeRLKHv8XzRxmqjUu30iH6fdT2pRon AaU0E8hzmfFEzIO9cijfmtaAv7+82p1Lr5ABO1hvOMEZp89RiU9GNdHJS7ciBjHt22NT4HcK6 g9zjk73FBADoyJMcNV2IfaAOkcG3iitVyUTKKuvmuun6dwJGuLwxwqSeucXFOFMlLp1r0Twow 32EYx9mh4sqTHFMdDIQXH0PBp1xbs4c4ORI64IEnEgy9UmTQ+Z92hC9ZZmndr0ebHPkt1klc5 Ns4J7dJVXsf/oJYxmhkdcFcmatPubcBP465S0aR99ioaL3MYzhrHd0KPZNceGBvIWtnEynafu HMpqr8b+rt9dhSU0utzEZhizy2PuWeKZTAlTpYiFGqoRC8HPtzUgBDcbfvxf/JcNZqYWlkFKJ iRO5a/LJr+/Qxqko8KthB4+96T6h0+/HzRd8N992OpAEiqQyEmTJ/KAyD3VPoyeTNZ1nGio6d mH/bfF7gBzVaMc7ZLxF/JA4NxGZ5urVzHay0wufjvpgw3tzoyIVdkjL9YjYDZ3VD8qs8Hdzc1 vNgpibHpNn4GyQo5MZI3iK3D7gwDR35qs4s55/77rIu5bgM+4vTUbFkN/2ivhBUoeXQsMS7C1 ph1a5KvIpaaj8DKjqX4LfsJtzQ8AZmM6iO0KnmhWfeUuHV1u6LYNLIyXPVFqjAeiEKu5/KzTT BZrtVDNPLjHrEW9EriTAuAbiY0Mi4xlBQS+jSWCs+Jtl4jcQuZjSIJaV+5d4B1qd070YMHC/T DXrZXvc 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: Wed, 20 Jul 2016 17:54:32 +0200 The drm_property_unreference_blob() 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/drm_atomic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 3cee084..8d2f111 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -404,8 +404,7 @@ drm_atomic_replace_property_blob(struct drm_property_blob **blob, if (old_blob == new_blob) return; - if (old_blob) - drm_property_unreference_blob(old_blob); + drm_property_unreference_blob(old_blob); if (new_blob) drm_property_reference_blob(new_blob); *blob = new_blob;