Skip to contentSkip to conversation

drm/amdkfd: remove redundant initialization to variable r

PATCH Applied Colin King 2 participants 2 messages Apr 22, 2021

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 drm/amdkfd: remove redundant initialization to variable r

From: Colin Ian King <[email protected]>

The variable r is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c +1 -1
index d44a46eb00d6..a66b67083d83 100644
@@ -303,7 +303,7 @@ svm_migrate_copy_to_vram(struct amdgpu_device *adev, struct svm_range *prange,
 	uint64_t vram_addr;
 	uint64_t offset;
 	uint64_t i, j;
-	int r = -ENOMEM;
+	int r;
 
 	pr_debug("svms 0x%p [0x%lx 0x%lx]\n", prange->svms, prange->start,
 		 prange->last);
Signature · 6 lines
2.30.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Applied
#1 lore raw

Am 2021-04-22 um 8:44 a.m. schrieb Colin King:

Quoted 8 lines

From: Colin Ian King <[email protected]>

The variable r is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

Applied to amd-staging-drm-next.

Thanks,
  Felix

Quoted 17 lines
---
 drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c +1 -1
index d44a46eb00d6..a66b67083d83 100644
@@ -303,7 +303,7 @@ svm_migrate_copy_to_vram(struct amdgpu_device *adev, struct svm_range *prange,
 	uint64_t vram_addr;
 	uint64_t offset;
 	uint64_t i, j;
-	int r = -ENOMEM;
+	int r;
 
 	pr_debug("svms 0x%p [0x%lx 0x%lx]\n", prange->svms, prange->start,
 		 prange->last);