From a8e7d69b18702f8d476022bb36b9fbca164b2fec Mon Sep 17 00:00:00 2001 From: Honglei Huang Date: Tue, 8 Jul 2025 18:22:07 +0800 Subject: [PATCH] libhsakmt: use uint32_t for loop index variables This patch changes the type of several loop index variables from int to uint32_t in fmm.c. The affected functions are: - __fmm_release - _fmm_map_to_gpu - _fmm_unmap_from_gpu To fix compile warning: warning: comparison of integer expressions of different signedness: 'int' and 'uint32_t' {aka 'unsigned int'} [-Wsign-compare] 2009 | for (i = 0; i < object->handle_num; i++) { Signed-off-by: Honglei Huang [ROCm/ROCR-Runtime commit: 45af009c5d23f4730617691b6ee979c33b130e68] --- projects/rocr-runtime/libhsakmt/src/fmm.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/projects/rocr-runtime/libhsakmt/src/fmm.c b/projects/rocr-runtime/libhsakmt/src/fmm.c index cdcc522ead..b3d5fe2237 100644 --- a/projects/rocr-runtime/libhsakmt/src/fmm.c +++ b/projects/rocr-runtime/libhsakmt/src/fmm.c @@ -1986,7 +1986,8 @@ void *hsakmt_fmm_allocate_host(uint32_t gpu_id, uint32_t node_id, void *address, static int __fmm_release(vm_object_t *object, manageable_aperture_t *aperture) { struct kfd_ioctl_free_memory_of_gpu_args args = {0}; - int ret = 0, i; + int ret = 0; + uint32_t i; if (!object) return -EINVAL; @@ -3100,7 +3101,8 @@ static HSAKMT_STATUS _fmm_map_to_gpu(manageable_aperture_t *aperture, struct kfd_ioctl_map_memory_to_gpu_args args = {0}; vm_object_t *object; HSAKMT_STATUS ret = HSAKMT_STATUS_SUCCESS; - int ret_ioctl, i; + int ret_ioctl; + uint32_t i; if (!obj) pthread_mutex_lock(&aperture->fmm_mutex); @@ -3357,7 +3359,8 @@ static int _fmm_unmap_from_gpu(manageable_aperture_t *aperture, void *address, vm_object_t *obj) { vm_object_t *object; - int ret = 0, tmp_ret, i; + int ret = 0, tmp_ret; + uint32_t i; struct kfd_ioctl_unmap_memory_from_gpu_args args = {0}; HSAuint32 page_offset = (HSAint64)address & (PAGE_SIZE - 1);