Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Subject: [PATCH 2/3] drm/xe: Remove unrequired NULL checks in xe_sync_entry_cleanup
Date: Tue, 20 Aug 2024 14:32:29 +0530	[thread overview]
Message-ID: <20240820090230.3258128-2-himal.prasad.ghimiray@intel.com> (raw)
In-Reply-To: <20240820090230.3258128-1-himal.prasad.ghimiray@intel.com>

dma_fence_put() and dma_fence_chain_free() can handle NULL input,
there is no need for NULL check by caller.

Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
---
 drivers/gpu/drm/xe/xe_sync.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_sync.c b/drivers/gpu/drm/xe/xe_sync.c
index a0675f57a398..436faff09bac 100644
--- a/drivers/gpu/drm/xe/xe_sync.c
+++ b/drivers/gpu/drm/xe/xe_sync.c
@@ -249,10 +249,8 @@ void xe_sync_entry_cleanup(struct xe_sync_entry *sync)
 {
 	if (sync->syncobj)
 		drm_syncobj_put(sync->syncobj);
-	if (sync->fence)
-		dma_fence_put(sync->fence);
-	if (sync->chain_fence)
-		dma_fence_chain_free(sync->chain_fence);
+	dma_fence_put(sync->fence);
+	dma_fence_chain_free(sync->chain_fence);
 	if (sync->ufence)
 		user_fence_put(sync->ufence);
 }
-- 
2.34.1


  parent reply	other threads:[~2024-08-20  8:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-20  9:02 [PATCH 1/3] drm/xe: Remove extra dma_fence_put on xe_sync_entry_add_deps failure Himal Prasad Ghimiray
2024-08-20  8:55 ` ✓ CI.Patch_applied: success for series starting with [1/3] " Patchwork
2024-08-20  8:56 ` ✓ CI.checkpatch: " Patchwork
2024-08-20  8:57 ` ✓ CI.KUnit: " Patchwork
2024-08-20  9:02 ` Himal Prasad Ghimiray [this message]
2024-08-20 16:05   ` [PATCH 2/3] drm/xe: Remove unrequired NULL checks in xe_sync_entry_cleanup Matthew Brost
2024-08-27  8:28   ` Nirmoy Das
2024-08-20  9:02 ` [PATCH 3/3] drm/xe: Remove unrequired NULL check in xe_sched_job_free_fences Himal Prasad Ghimiray
2024-08-20 16:05   ` Matthew Brost
2024-08-20 17:06   ` Randhawa, Jagmeet
2024-08-27  8:29   ` Nirmoy Das
2024-08-20  9:09 ` ✓ CI.Build: success for series starting with [1/3] drm/xe: Remove extra dma_fence_put on xe_sync_entry_add_deps failure Patchwork
2024-08-20  9:11 ` ✓ CI.Hooks: " Patchwork
2024-08-20  9:13 ` ✓ CI.checksparse: " Patchwork
2024-08-20  9:33 ` ✓ CI.BAT: " Patchwork
2024-08-20 14:16 ` ✓ CI.FULL: " Patchwork
2024-08-27  8:43   ` Nirmoy Das
2024-08-20 16:02 ` [PATCH 1/3] " Matthew Brost
2024-08-20 18:52 ` Dixit, Ashutosh
2024-08-27  8:29 ` Nirmoy Das

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240820090230.3258128-2-himal.prasad.ghimiray@intel.com \
    --to=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox