Skip to contentSkip to conversation

drm/amdkfd: fix typing in (*hqd_destroy)

PATCH In review Luc Van Oostenryck 2 participants 2 messages Apr 24, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdkfd: fix typing in (*hqd_destroy)

The method (*hqd_destroy) is defined as using an 'uint32_t' as 3rd argument but the the actual implementation of this method and all its calls actually uses an 'enum kfd_preempt_type' for this argument.

Fix this by using 'enum kfd_preempt_type' for (*hqd_destroy) too.

---
 drivers/gpu/drm/amd/include/kgd_kfd_interface.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/include/kgd_kfd_interface.h +1 -1
index 237289a72..2890e8581 100644
@@ -298,7 +298,7 @@ struct kfd2kgd_calls {
 	bool (*hqd_is_occupied)(struct kgd_dev *kgd, uint64_t queue_address,
 				uint32_t pipe_id, uint32_t queue_id);
 
-	int (*hqd_destroy)(struct kgd_dev *kgd, void *mqd, uint32_t reset_type,
+	int (*hqd_destroy)(struct kgd_dev *kgd, void *mqd, enum kfd_preempt_type reset_type,
 				unsigned int timeout, uint32_t pipe_id,
 				uint32_t queue_id);
 
Signature · 1 line
2.17.0
maintainer
#1 lore raw
Quoted 8 lines · Luc Van Oostenryck

The method (*hqd_destroy) is defined as using an 'uint32_t' as 3rd argument but the the actual implementation of this method and all its calls actually uses an 'enum kfd_preempt_type' for this argument.

Fix this by using 'enum kfd_preempt_type' for (*hqd_destroy) too.

Interesting. I'm surprised I never saw a compiler warning about a function pointer type mismatch. I guess C isn't picky about integer types as long as the size is the same.

Anyway, this patch is Reviewed-by: Felix Kuehling <[email protected]>

Quoted 9 lines
---
 drivers/gpu/drm/amd/include/kgd_kfd_interface.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/include/kgd_kfd_interface.h +0 -0
index 237289a72..2890e8581 100644

drivers/gpu/drm/amd/include/kgd_kfd_interface.h struct kfd2kgd_calls { · line 304

Quoted 8 lines
drivers/gpu/drm/amd/include/kgd_kfd_interface.h +1 -1
@@ -298,7 +298,7 @@ struct kfd2kgd_calls {
 	bool (*hqd_is_occupied)(struct kgd_dev *kgd, uint64_t queue_address,
 				uint32_t pipe_id, uint32_t queue_id);
 
-	int (*hqd_destroy)(struct kgd_dev *kgd, void *mqd, uint32_t reset_type,
+	int (*hqd_destroy)(struct kgd_dev *kgd, void *mqd, enum kfd_preempt_type reset_type,
 				unsigned int timeout, uint32_t pipe_id,
 				uint32_t queue_id);
 

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel