Skip to content

Commit afaf425

Browse files
Yury Norovalexdeucher
authored andcommitted
drm/amdkfd: simplify svm_range_unmap_from_gpus()
The function calls bitmap_or() followed by for_each_set_bit(). Switch it to the dedicated for_each_or_bit() and drop the temporary bitmap. Signed-off-by: Yury Norov <ynorov@nvidia.com> Signed-off-by: Felix Kuehling <felix.kuehling@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 532e2c8 commit afaf425

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

drivers/gpu/drm/amd/amdkfd/kfd_svm.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,6 @@ static int
13721372
svm_range_unmap_from_gpus(struct svm_range *prange, unsigned long start,
13731373
unsigned long last, uint32_t trigger)
13741374
{
1375-
DECLARE_BITMAP(bitmap, MAX_GPU_INSTANCE);
13761375
struct kfd_process_device *pdd;
13771376
struct dma_fence *fence = NULL;
13781377
struct kfd_process *p;
@@ -1390,11 +1389,9 @@ svm_range_unmap_from_gpus(struct svm_range *prange, unsigned long start,
13901389
prange->mapped_to_gpu = false;
13911390
}
13921391

1393-
bitmap_or(bitmap, prange->bitmap_access, prange->bitmap_aip,
1394-
MAX_GPU_INSTANCE);
13951392
p = container_of(prange->svms, struct kfd_process, svms);
13961393

1397-
for_each_set_bit(gpuidx, bitmap, MAX_GPU_INSTANCE) {
1394+
for_each_or_bit(gpuidx, prange->bitmap_access, prange->bitmap_aip, MAX_GPU_INSTANCE) {
13981395
pr_debug("unmap from gpu idx 0x%x\n", gpuidx);
13991396
pdd = kfd_process_device_from_gpuidx(p, gpuidx);
14001397
if (!pdd) {

0 commit comments

Comments
 (0)