diff mbox series

drm/amdgpu: remove redundant assignment of variable k

Message ID 20210603123440.83936-1-colin.king@canonical.com (mailing list archive)
State New, archived
Headers show
Series drm/amdgpu: remove redundant assignment of variable k | expand

Commit Message

Colin King June 3, 2021, 12:34 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The variable k is being assigned a value that is never read, the
assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Felix Kuehling June 3, 2021, 3:22 p.m. UTC | #1
Am 2021-06-03 um 8:34 a.m. schrieb Colin King:
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable k is being assigned a value that is never read, the
> assignment is redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>

I'm applying the patch to amd-staging-drm-next.

Thanks,
  Felix


> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> index 2a7bed66d50b..f545dc1248b8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> @@ -278,7 +278,7 @@ static int amdgpu_amdkfd_remove_eviction_fence(struct amdgpu_bo *bo,
>  	write_seqcount_end(&resv->seq);
>  
>  	/* Drop the references to the removed fences or move them to ef_list */
> -	for (i = j, k = 0; i < old->shared_count; ++i) {
> +	for (i = j; i < old->shared_count; ++i) {
>  		struct dma_fence *f;
>  
>  		f = rcu_dereference_protected(new->shared[i],
Christian König June 4, 2021, 7:52 a.m. UTC | #2
Am 03.06.21 um 14:34 schrieb Colin King:
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable k is being assigned a value that is never read, the
> assignment is redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> index 2a7bed66d50b..f545dc1248b8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> @@ -278,7 +278,7 @@ static int amdgpu_amdkfd_remove_eviction_fence(struct amdgpu_bo *bo,
>   	write_seqcount_end(&resv->seq);
>   
>   	/* Drop the references to the removed fences or move them to ef_list */
> -	for (i = j, k = 0; i < old->shared_count; ++i) {
> +	for (i = j; i < old->shared_count; ++i) {
>   		struct dma_fence *f;
>   
>   		f = rcu_dereference_protected(new->shared[i],
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
index 2a7bed66d50b..f545dc1248b8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -278,7 +278,7 @@  static int amdgpu_amdkfd_remove_eviction_fence(struct amdgpu_bo *bo,
 	write_seqcount_end(&resv->seq);
 
 	/* Drop the references to the removed fences or move them to ef_list */
-	for (i = j, k = 0; i < old->shared_count; ++i) {
+	for (i = j; i < old->shared_count; ++i) {
 		struct dma_fence *f;
 
 		f = rcu_dereference_protected(new->shared[i],