From patchwork Fri Jul 15 18:28:18 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: 9232427 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 E64A960868 for ; Fri, 15 Jul 2016 18:28:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DAED72236A for ; Fri, 15 Jul 2016 18:28:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF7E9264F4; Fri, 15 Jul 2016 18:28:33 +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 6CEC52236A for ; Fri, 15 Jul 2016 18:28:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0C3AC6EA8C; Fri, 15 Jul 2016 18:28:31 +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 43E766EA8C for ; Fri, 15 Jul 2016 18:28:29 +0000 (UTC) Received: from [192.168.1.2] ([77.182.179.66]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0Mf0W1-1bhj290MjR-00OafP; Fri, 15 Jul 2016 20:28:24 +0200 Subject: [PATCH] drm/ttm: Delete an unnecessary check before the function call "ttm_tt_destroy" To: David Airlie , dri-devel@lists.freedesktop.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> <5649EC25.3040004@users.sourceforge.net> From: SF Markus Elfring Message-ID: Date: Fri, 15 Jul 2016 20:28:18 +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: <5649EC25.3040004@users.sourceforge.net> X-Provags-ID: V03:K0:5VB2zQu9/EeRINGwhxPAdQIO5v6I8zXTU1OTcNSbkHnUhhVBWO/ exheOlVOhspUOYh8ZjIG6ViPNDyfzNNsOhbvjwzLHeJ8QFPw6ZWSkC48qnMZJCM7SjupeqV 0dkjWSY7K01ej6/mhbq09hOQIgytZhgPwiTgNZT+CAcEZQGfVMjfkPkGT9smIGJDk8FAdPL wsfiScXFW86aFlgfXt6QQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:kUvbadEPbXQ=:5Mbi+HmPL7bBXPhPXx7Pl/ ehenDfTQgB+Hk2zHn09vU4jMEuLDPaw6a5liRomsoGoKh6QK33QkTr6/wRwsaYPXanBi/jXQz jDSp4FKbAgtEek2o6L6IqgsnMt+J151qh12R6TOyoHu9B3lzzEdG54HxDQYMUUyh066Gezyq6 Z4QxUt1EMAmpScSf/Ckb2TV8AB2P2x6KzSc459X7W5kaNK5vEbKLHZ5oHnfPUA6vSdBDDK4+1 ylxa5x+rTkehkX5bxM6usIwol3mSDJ1iZp+2UQOQKzFWNB/P8AtpruxZldrsV3ru2VRO4dLxh h428QK6vzL7789nBqVpq2YGuGjcEnx0zb23fed9BJ0tSNSCdf1tqf6ahkGrjidY8MeZ+ghacY s+l0D3rWO3GoLYVGPHbJDmJ8oe9OyGXjyVFOzd7G8hHjajDSX9iwcZayEDrEVicEuftK6t36R qBT5fWs2b53P8cwTusEUXNHi3cwalrW7r/4yys6QYze8UD3G6wnuJHTuqIZ5IZZmnCh605GDs YVcqfUtrj8dKmfZF33aXT2qsC2LmChlxXUb7K8SkjeZDTCas8zH5hnM4gxmwmQ18arzb99CI5 9xPYLmI8rIcPzB00caSvYUP+LHJgEIPxZuyoFch7OjtUmF6A59jkuE/RgVWOOsNcyV9L/iQH6 DG1yUVh4y7coA3KjG8fl0xmR305pLx4ACnmIa38T83+vkKSUj0iUV0e0BP/3c5Yb1OJJR7ftf 46mKzapTde41B3lAF1BlUgTIxVD5b+KqpRA2edtBPInZ65p66Sd0WbpLUOWC4GiWeGtYfOs4L E5slkzF 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: Fri, 15 Jul 2016 20:20:48 +0200 The ttm_tt_destroy() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. Signed-off-by: Markus Elfring --- drivers/gpu/drm/ttm/ttm_bo.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 39386f5..23809d0 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -146,9 +146,7 @@ static void ttm_bo_release_list(struct kref *list_kref) BUG_ON(bo->mem.mm_node != NULL); BUG_ON(!list_empty(&bo->lru)); BUG_ON(!list_empty(&bo->ddestroy)); - - if (bo->ttm) - ttm_tt_destroy(bo->ttm); + tm_tt_destroy(bo->ttm); atomic_dec(&bo->glob->bo_count); if (bo->resv == &bo->ttm_resv) reservation_object_fini(&bo->ttm_resv);