Skip to contentSkip to conversation

drm/i915: Fix pointer-to-int conversion

PATCH Superseded Michal Wajdeczko 2 participants 2 messages Oct 6, 2017

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Fix pointer-to-int conversion

Commit faf654864b25 ("drm/i915: Unify uC variable types to avoid flooding checkpatch.pl") breaks 32-bit kernel builds. Lets use chained cast to make compiler happy.

Cc Joonas Lahtinen <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/i915/i915_guc_submission.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_guc_submission.c +2 -2
index a2fad82..8b4a119 100644
@@ -388,13 +388,13 @@ static void guc_stage_desc_init(struct intel_guc *guc,
 	gfx_addr = guc_ggtt_offset(client->vma);
 	desc->db_trigger_phy = sg_dma_address(client->vma->pages->sgl) +
 				client->doorbell_offset;
-	desc->db_trigger_cpu = (u64)__get_doorbell(client);
+	desc->db_trigger_cpu = (u64)(uintptr_t)__get_doorbell(client);
 	desc->db_trigger_uk = gfx_addr + client->doorbell_offset;
 	desc->process_desc = gfx_addr + client->proc_desc_offset;
 	desc->wq_addr = gfx_addr + GUC_DB_SIZE;
 	desc->wq_size = GUC_WQ_SIZE;
 
-	desc->desc_private = (u64)client;
+	desc->desc_private = (u64)(uintptr_t)client;
 }
 
 static void guc_stage_desc_fini(struct intel_guc *guc,
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

Quoting Michal Wajdeczko (2017-10-06 13:36:56)

Quoted 7 lines

Commit faf654864b25 ("drm/i915: Unify uC variable types to avoid flooding checkpatch.pl") breaks 32-bit kernel builds. Lets use chained cast to make compiler happy.

Cc Joonas Lahtinen <[email protected]>
Cc Chris Wilson <[email protected]>

i915_utils.h: static inline u64 ptr_to_u64(const void *ptr) { return (uinptr_t)ptr; }

Might as well try to hide the worst of C casting?
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx