summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Wajdeczko <michal.wajdeczko@intel.com>2024-12-20 22:41:55 +0300
committerMichal Wajdeczko <michal.wajdeczko@intel.com>2025-01-19 02:11:57 +0300
commitd29cddd49bed2c880e7c17724bcf3604e865c23a (patch)
tree0cf414b813848555584368f8e8854b160ac1e723
parent9cd3f4efc870463f17f6c29114c61fb6bfcaa291 (diff)
downloadlinux-d29cddd49bed2c880e7c17724bcf3604e865c23a.tar.xz
drm/xe/sa: Drop redundant NULL assignments
The sa_manager is drmm_kzalloc'ed so all members are already zero. And in case of kvzalloc() failure we are not returning pointer to the sa_manager at all, so no point in resetting .bo member. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241220194205.995-3-michal.wajdeczko@intel.com
-rw-r--r--drivers/gpu/drm/xe/xe_sa.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/gpu/drm/xe/xe_sa.c b/drivers/gpu/drm/xe/xe_sa.c
index 4e7aba445ebc..eb314ca75355 100644
--- a/drivers/gpu/drm/xe/xe_sa.c
+++ b/drivers/gpu/drm/xe/xe_sa.c
@@ -44,8 +44,6 @@ struct xe_sa_manager *xe_sa_bo_manager_init(struct xe_tile *tile, u32 size, u32
if (!sa_manager)
return ERR_PTR(-ENOMEM);
- sa_manager->bo = NULL;
-
bo = xe_managed_bo_create_pin_map(xe, tile, size,
XE_BO_FLAG_VRAM_IF_DGFX(tile) |
XE_BO_FLAG_GGTT |
@@ -61,10 +59,8 @@ struct xe_sa_manager *xe_sa_bo_manager_init(struct xe_tile *tile, u32 size, u32
if (bo->vmap.is_iomem) {
sa_manager->cpu_ptr = kvzalloc(managed_size, GFP_KERNEL);
- if (!sa_manager->cpu_ptr) {
- sa_manager->bo = NULL;
+ if (!sa_manager->cpu_ptr)
return ERR_PTR(-ENOMEM);
- }
} else {
sa_manager->cpu_ptr = bo->vmap.vaddr;
memset(sa_manager->cpu_ptr, 0, bo->ttm.base.size);