Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1445510

[PATCH v3] drm/ttm: Delete an unnecessary check before the function call "ttm_tt_destroy"

Path csiph.com!news.freedyn.net!eternal-september.org!feeder.eternal-september.org!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject [PATCH v3] drm/ttm: Delete an unnecessary check before the function call "ttm_tt_destroy"
Date Mon, 18 Jul 2016 16:20:01 +0200
Message-ID <rWhyN-7ha-17@gated-at.bofh.it> (permalink)
References <mSsDN-4wa-53@gated-at.bofh.it> <mSsDN-4wa-55@gated-at.bofh.it> <mSsDN-4wa-57@gated-at.bofh.it> <mSsDN-4wa-59@gated-at.bofh.it> <mSsDN-4wa-61@gated-at.bofh.it> <mSsDN-4wa-63@gated-at.bofh.it> <mSsDN-4wa-65@gated-at.bofh.it> <mSsDN-4wa-33@gated-at.bofh.it> <qvtgu-6H-15@gated-at.bofh.it> <rVg26-1P7-25@gated-at.bofh.it> <rWb0m-38e-5@gated-at.bofh.it>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2
MIME-Version 1.0
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding 7bit
X-Provags-ID V03:K0:7Hf5+g3rmbbAki+YdsWf5AagxM86KtHfOQkHiXGc7Sm+KvKYVqJ +K4zx2vpa+2+kjnoSOyBOthZLwWl1/GPVDkzUWYO6GgXs93iQno3KCLmnmLLr+KhrCfy+Ex Zaea8fkxAI7Jju9KM4gsjwaV8VP14n/AOVyTLY2hNx8fdo5jPB7VO9nKW46TA9JLtnCqbgH yePJH/Ossz/Q1jluuI/mA==
X-Ui-Out-Filterresults notjunk:1;V01:K0:7J1QMxXhbD4=:J2KPPzXda/ijiwKcFrTo+I AFen42XigtCn0qdMGXcrNHuQy2LZ+5QZExMFeuOE0NQe5TcZ/4m6YSGNqxGasPfHCCi3GAMaM 5e+Ig4tn20c44OOs/MHcBh23IqlpEfFCE6w0N5Aa8FkmYeC20mS2e8HSdS4811HsSND9Z6G3c 6YU84gBPfxsbTEAEISUpmp61ibQGYnOHyX9MfzCWqBNPl1Bu5iFm8AfNPv6WL6ohA079ixoOT 1mFBdVdOWWgx4aHWlHwf6uswF5sP5kKR506tJYEZN8snoRjUSGffO5B6Lb03F4wM4B9F/WsB7 CwFn11AEC72aU18eM2Pw4JpL8rIWOsF2L5W73BiCSFvjbdhRhDgQ16e25kCaTRD/gL9CcA+J0 be9dNdfQFmSs6W+3rMpGhtqaNA3lct5SZqSoIWCunf8NGa1L6l3fva5aRn14DX7tckzxdAB9f 4Xtm+1EHH52ApqhLikLRc9/nyxcs/xjKzlYBZpnXacD1dhjdF1GfxVGv4QlkbjERxjW66QA3z yho68eUSv0XxhnZjEra7JQ7Sh1CMLK+cGnVFf2F82zcul19OF2f9u9cj6xjH6x9T2r6DFPBqu Zi7T8E2xqzsIphIQCvjGuAniS2yUrmk7pZ0NDNj+gj1zRwbem8s93O5Btpl1TW24p5D9AApDG 8icq9NIYRGg3qZlpQho3JtAK81N7P2biDRKaLVPGn0ZNM/70TQLMJ5RHRm5bvPooB62qVLUZ+ YaQEq4A5nbhq7wga3aI5tnoypPVQ0fMtZpPgT6bH26w/TWQsEgRz8nPuI1Yy3FOHpk5OsB1GX 95GKyx0
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 30
Organization linux.* mail to news gateway
X-Original-Cc LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org, Julia Lawall <julia.lawall@lip6.fr>
X-Original-Date Mon, 18 Jul 2016 16:10:36 +0200
X-Original-Message-ID <54338f58-830c-a8b4-4554-5d4459bcd321@users.sourceforge.net>
X-Original-References <alpine.DEB.2.10.1402251014170.2080@hadrien> <530CD2C4.4050903@users.sourceforge.net> <alpine.DEB.2.10.1402251840450.7035@hadrien> <530CF8FF.8080600@users.sourceforge.net> <alpine.DEB.2.02.1402252117150.2047@localhost6.localdomain6> <530DD06F.4090703@users.sourceforge.net> <alpine.DEB.2.02.1402262129250.2221@localhost6.localdomain6> <5317A59D.4@users.sourceforge.net> <5649EC25.3040004@users.sourceforge.net> <ec9bf71e-8d0f-4bf3-b2ba-b0b1bd444b22@users.sourceforge.net> <20160718071208.GV17101@phenom.ffwll.local>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1445510

Show key headers only | View raw


From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 18 Jul 2016 16:06:18 +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.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 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..4e55863 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);
+	ttm_tt_destroy(bo->ttm);
 	atomic_dec(&bo->glob->bo_count);
 	if (bo->resv == &bo->ttm_resv)
 		reservation_object_fini(&bo->ttm_resv);
-- 
2.9.2

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] drm/ttm: Delete an unnecessary check before the function call  "ttm_tt_destroy" SF Markus Elfring <elfring@users.sourceforge.net> - 2016-07-15 20:30 +0200
  Re: [PATCH] drm/ttm: Delete an unnecessary check before the function  call "ttm_tt_destroy" Daniel Vetter <daniel@ffwll.ch> - 2016-07-18 09:20 +0200
    [PATCH v3] drm/ttm: Delete an unnecessary check before the function  call "ttm_tt_destroy" SF Markus Elfring <elfring@users.sourceforge.net> - 2016-07-18 16:20 +0200
      Re: [PATCH v3] drm/ttm: Delete an unnecessary check before the  function call "ttm_tt_destroy" Daniel Vetter <daniel@ffwll.ch> - 2016-07-18 16:50 +0200
        Re: drm/ttm: Delete an unnecessary check before the function call  "ttm_tt_destroy" SF Markus Elfring <elfring@users.sourceforge.net> - 2016-07-18 19:10 +0200
        Re: [PATCH v3] drm/ttm: Delete an unnecessary check before the  function call "ttm_tt_destroy" Geert Uytterhoeven <geert@linux-m68k.org> - 2016-07-19 10:20 +0200
          Re: [PATCH v3] drm/ttm: Delete an unnecessary check before the  function call "ttm_tt_destroy" Daniel Vetter <daniel@ffwll.ch> - 2016-07-19 10:30 +0200

csiph-web