From patchwork Sun Jul 5 20:00:21 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: 6719021 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BC1ADC05AC for ; Mon, 6 Jul 2015 01:20:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B31E620643 for ; Mon, 6 Jul 2015 01:20:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 72D2E2063B for ; Mon, 6 Jul 2015 01:20:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 74DB36E2DE; Sun, 5 Jul 2015 18:20:53 -0700 (PDT) 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 ESMTPS id 850096E259 for ; Sun, 5 Jul 2015 13:00:31 -0700 (PDT) Received: from [192.168.1.2] ([78.49.236.106]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0M3jwL-1Yttf73QtV-00rJ6S; Sun, 05 Jul 2015 22:00:24 +0200 Message-ID: <55998CD5.3080204@users.sourceforge.net> Date: Sun, 05 Jul 2015 22:00:21 +0200 From: SF Markus Elfring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: David Airlie , dri-devel@lists.freedesktop.org Subject: [PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob() 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:sKaWLXBrxr82Z1Uu23BGKHuNYnkm4W/tnD6yzHEJVNrsytdjPNw FsZT4dHxtKulWbIBHEL4XTGhJQeNS45SIgV+E2xxeqCuxVu1crPIKUahCN7mm+RjVjzqG9U atSTNb+3GN5YEBERvbAKRecSGCWdAnvPjVlx7iKyZEoiLBiZ4mM1HEBKEAwKS/gL7QJ1duP DnHytITE/aTcve9oaHX0A== X-UI-Out-Filterresults: notjunk:1; V01:K0:YLaP0pGX9js=:JriTXE3ZQoVVyGsdHemxnz I4unMyeL83C0eO+N+ERSy8v0cfuh02tEwgZxkMAyFcdl2EpJRz235atAEU50ET/sVxwGt03h6 dwxCmouZP+nw0NY0DU++GHYW7KtbFh/BoUoeoqBwApZRbDsF+GVig6q9YNudESS2GenL0yn1/ 3laDnt9Czm0vQ3HnQ3xzFvzhIp/B4zoJ0O8HTvO7HaIgxcfDuqJOxKNkSvdDQF8BhRAte+gSV nrjOCH4OPeBIjt1Cmi5JP6P1k/G514libZNzM92WlNpq9y852jlZCuoRvXXRSV5dVHrdzNIcC jerpxvJ8TUoD6bPjx62Y03CDoBkDEqGFw31DalmBnzl5DUP9z1a+EhfrapB4yc7U1Qd5eFWZ2 2Gy07vG03AOZ9P369itiZZLpOEi6xuyUUGpRJF2PQ7MVVxXF/sKodyyZ/7ZBXZJuG8pzqyOEH hpgHSk91QitsC/IRBSzuF34HkxFSSukD/Pvrdv8VQT0EiQk4zgFk382PF0OZCwK1rYICq6gDM fJoPbezvRBbI72PGJWU3ERTtgxB84j6sKXZnxLd0kqzjdHgE1ufbAxHtCgnaf1xu6aBeaNCil S+0RLhYnUN+AC8hOquZPoECynJvRRJWL++y8Nqj239ymKFWGGX7gjcMhkfjW2EDWXdaiGkcFm 4c8Efm89phr7yjyBHTLCpZixgiapvzFzgbJ/Q6mUMU3yLw/mR3o3eGga2ZwBME7QfC08= X-Mailman-Approved-At: Sun, 05 Jul 2015 18:20:52 -0700 Cc: Julia Lawall , kernel-janitors@vger.kernel.org, Linux Kernel Mailing List 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.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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: Sun, 5 Jul 2015 21:55:10 +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 Reviewed-by: Zhao Junwang --- drivers/gpu/drm/drm_crtc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 2d57fc5..6e4c8b0 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -4469,9 +4469,7 @@ static int drm_property_replace_global_blob(struct drm_device *dev, goto err_created; } - if (old_blob) - drm_property_unreference_blob(old_blob); - + drm_property_unreference_blob(old_blob); *replace = new_blob; return 0;