drm/amdgpu: fix warning for overflow check
authorjsg <jsg@openbsd.org>
Fri, 19 Nov 2021 03:17:33 +0000 (03:17 +0000)
committerjsg <jsg@openbsd.org>
Fri, 19 Nov 2021 03:17:33 +0000 (03:17 +0000)
From Arnd Bergmann
375150b3aaf8cf7d01f6f0b582e264dd2fded814 in linux 5.10.y/5.10.80
335aea75b0d95518951cad7c4c676e6f1c02c150 in mainline linux

sys/dev/pci/drm/amd/amdgpu/amdgpu_bo_list.c
sys/dev/pci/drm/amd/amdgpu/amdgpu_bo_list.h

index a538367..0f4a525 100644 (file)
@@ -61,7 +61,7 @@ static void amdgpu_bo_list_free(struct kref *ref)
 
 int amdgpu_bo_list_create(struct amdgpu_device *adev, struct drm_file *filp,
                          struct drm_amdgpu_bo_list_entry *info,
-                         unsigned num_entries, struct amdgpu_bo_list **result)
+                         size_t num_entries, struct amdgpu_bo_list **result)
 {
        unsigned last_entry = 0, first_userptr = num_entries;
        struct amdgpu_bo_list_entry *array;
index f5fb5ba..4e1cde9 100644 (file)
@@ -60,7 +60,7 @@ int amdgpu_bo_create_list_entry_array(struct drm_amdgpu_bo_list_in *in,
 int amdgpu_bo_list_create(struct amdgpu_device *adev,
                                 struct drm_file *filp,
                                 struct drm_amdgpu_bo_list_entry *info,
-                                unsigned num_entries,
+                                size_t num_entries,
                                 struct amdgpu_bo_list **list);
 
 static inline struct amdgpu_bo_list_entry *