From patchwork Wed Jul 13 18:02:20 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: 9228337 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 3E39660572 for ; Wed, 13 Jul 2016 18:02:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3428027165 for ; Wed, 13 Jul 2016 18:02:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2876127F8E; Wed, 13 Jul 2016 18:02:29 +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 1027B27165 for ; Wed, 13 Jul 2016 18:02:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E92076E7AB; Wed, 13 Jul 2016 18:02:26 +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 DE47F6E7AB for ; Wed, 13 Jul 2016 18:02:24 +0000 (UTC) Received: from [192.168.1.2] ([78.53.182.169]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0MS29q-1bpYH93026-00TE3s; Wed, 13 Jul 2016 20:02:21 +0200 Subject: [PATCH 3/3] drm/msm: Delete an unnecessary check before drm_gem_object_unreference() To: David Airlie , Rob Clark , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org 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> <351a1279-b0ca-5f5e-d175-28c9de8406f6@users.sourceforge.net> From: SF Markus Elfring Message-ID: <78fbe696-0f73-b396-a986-064f2ad9f22a@users.sourceforge.net> Date: Wed, 13 Jul 2016 20:02:20 +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: <351a1279-b0ca-5f5e-d175-28c9de8406f6@users.sourceforge.net> X-Provags-ID: V03:K0:4XR7Dvy+JK7jmtPaYFErJV18fNvuNA7JZkkk9MNdTSvJIQxZ8BO ADLWlJ9NzBieu0bgTAUg9boXXKPml4MMyh4E+yTi19E751Ccb0hiPkSE1AEXKr1J9xcKbn7 heAf6ZM2jfZUyLl5BNYxAHYw3sfqsJ+eoLhhnOsBVqJZlSHP5h79S2S7qyPpeH9pzFzz9al YQBnFrKTdrLC0Ltgq+KAw== X-UI-Out-Filterresults: notjunk:1; V01:K0:wh7AULzl7rY=:uODOn+LdK6F6ncmyMgOYlI q2RBdNyo/xOQW2Q1C/MPtC1qr4xm0fR9gXHouxRCy5MS5HKAi3wVJt9NriXFAjMEWA6EzqS+R Ga7IpTR+HBm4egMfUwUK0eVjsoB8JLPyjr7kEM+o3o+RCA4p73pGcKW40nSLjKe8nkU56YaXb kR1nvOVhzWsynXS3P8KbBpkroKMFYMLPazfCIaqOVcNg/HLrfdkg9v3LH3hgoKDioOgkKRV8d AXk8c58nw8JBfnObTQmgt6OQ9exz6Tm00OfrwxxWQwLmuEGrR44LCeef+vXymbr6BFUZ3WEJY piHxc9ozlfMSllJCYMbnWtra17vlwEz9Chi5dPcz+ttqoxvaUoNYgmRueEasUpVWyObNuIWzq +vLX6jpvui5hGsvC0bIbIgzpkREGn5O+zBrQ8lh4e6nR6t3uq3wmqfDEBPEijWeXdIfYVtKea keqKwQ49Y7FZG9zesB4LfQCMADhCrCP2erhUxRPhDgB6Eft21RaAhv/c+PlrSQQV7oQIrEV2F cxT1GCBoRFR82+ve0aDRAAPWJrXGF16qf8Ujf2bPrT4KhU5MVYn5MJGOWl+edov4VDgn0sLt0 rwC/q8VOTnzJa6ydbyrgh9tc6Cfccy8DqpSOTvnYUJ2Tgz2bi6viyk7nj9UBTfppzmMNDR8h7 vRrJ03TRwFgBGIt1F974QKn6cc8GP+mJQhgCuf94FIrWZfOKWQqraxw/haU/fNHrk/SH+CPen 1Wkn/QLJ/VsMuISl0YMWDk4Od6L3B0M5PzO+aQR9ncIG3tddLdThkXuxGwehzZPda1ZD6sntI 5C9s+hL 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, 13 Jul 2016 19:29:19 +0200 The drm_gem_object_unreference() 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/msm/msm_gem.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c index 9a713fb..6cd4af4 100644 --- a/drivers/gpu/drm/msm/msm_gem.c +++ b/drivers/gpu/drm/msm/msm_gem.c @@ -830,9 +830,7 @@ struct drm_gem_object *msm_gem_new(struct drm_device *dev, return obj; fail: - if (obj) - drm_gem_object_unreference(obj); - + drm_gem_object_unreference(obj); return ERR_PTR(ret); }