mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
drm/amdkfd: use vma_lookup() instead of find_vma()
Using vma_lookup() verifies the start address is contained in the found vma. This results in easier to read the code. Signed-off-by: Deming Wang <wangdeming@inspur.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
178919f8ff
commit
3a3e841d05
@@ -529,8 +529,8 @@ svm_migrate_ram_to_vram(struct svm_range *prange, uint32_t best_loc,
|
||||
for (addr = start; addr < end;) {
|
||||
unsigned long next;
|
||||
|
||||
vma = find_vma(mm, addr);
|
||||
if (!vma || addr < vma->vm_start)
|
||||
vma = vma_lookup(mm, addr);
|
||||
if (!vma)
|
||||
break;
|
||||
|
||||
next = min(vma->vm_end, end);
|
||||
@@ -798,8 +798,8 @@ int svm_migrate_vram_to_ram(struct svm_range *prange, struct mm_struct *mm,
|
||||
for (addr = start; addr < end;) {
|
||||
unsigned long next;
|
||||
|
||||
vma = find_vma(mm, addr);
|
||||
if (!vma || addr < vma->vm_start) {
|
||||
vma = vma_lookup(mm, addr);
|
||||
if (!vma) {
|
||||
pr_debug("failed to find vma for prange %p\n", prange);
|
||||
r = -EFAULT;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user