[PATCH] drm/amdkfd: simplify else if to else check of MIGRATION_COPY_DIR

trix at redhat.com trix at redhat.com
Sat Jan 22 14:35:49 UTC 2022


From: Tom Rix <trix at redhat.com>

The enum MIGRATION_COPY_DIR type has 2 values.  So
the else-if can be converted to an else.

Signed-off-by: Tom Rix <trix at redhat.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
index d986f9ee0e1f4..c06c44f37b00e 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
@@ -146,7 +146,8 @@ svm_migrate_copy_memory_gart(struct amdgpu_device *adev, dma_addr_t *sys,
 			gart_s = svm_migrate_direct_mapping_addr(adev, *vram);
 			r = svm_migrate_gart_map(ring, size, sys, &gart_d, 0);
 
-		} else if (direction == FROM_RAM_TO_VRAM) {
+		} else {
+			/* direction == FROM_RAM_TO_VRAM */
 			r = svm_migrate_gart_map(ring, size, sys, &gart_s,
 						 KFD_IOCTL_SVM_FLAG_GPU_RO);
 			gart_d = svm_migrate_direct_mapping_addr(adev, *vram);
-- 
2.26.3



More information about the amd-gfx mailing list