Skip to contentSkip to conversation

drm/amdgpu: remove redundant variable r and redundant return statement

PATCH Applied Colin King 3 participants 3 messages Oct 3, 2019 – Oct 4, 2019

Subsystems (3)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 drm/amdgpu: remove redundant variable r and redundant return statement

From: Colin Ian King <[email protected]>

There is a return statement that is not reachable and a variable that is not used. Remove them.

Addresses-Coverity: ("Structurally dead code")

Fixes de7b45babd9b ("drm/amdgpu: cleanup creating BOs at fixed location (v2)")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0 -2
index 481e4c381083..814159f15633 100644
@@ -1636,7 +1636,6 @@ static void amdgpu_ttm_fw_reserve_vram_fini(struct amdgpu_device *adev)
 static int amdgpu_ttm_fw_reserve_vram_init(struct amdgpu_device *adev)
 {
 	uint64_t vram_size = adev->gmc.visible_vram_size;
-	int r;
 
 	adev->fw_vram_usage.va = NULL;
 	adev->fw_vram_usage.reserved_bo = NULL;
@@ -1651,7 +1650,6 @@ static int amdgpu_ttm_fw_reserve_vram_init(struct amdgpu_device *adev)
 					  AMDGPU_GEM_DOMAIN_VRAM,
 					  &adev->fw_vram_usage.reserved_bo,
 					  &adev->fw_vram_usage.va);
-	return r;
 }
 
 /**
Signature · 1 line
2.20.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

Am 03.10.19 um 23:40 schrieb Colin King:

Quoted 8 lines

From: Colin Ian King <[email protected]>

There is a return statement that is not reachable and a variable that is not used. Remove them.

Addresses-Coverity: ("Structurally dead code")

Fixes de7b45babd9b ("drm/amdgpu: cleanup creating BOs at fixed location (v2)")
Quoted 17 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 --
  1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0 -1
index 481e4c381083..814159f15633 100644
@@ -1636,7 +1636,6 @@ static void amdgpu_ttm_fw_reserve_vram_fini(struct amdgpu_device *adev)
  static int amdgpu_ttm_fw_reserve_vram_init(struct amdgpu_device *adev)
  {
  	uint64_t vram_size = adev->gmc.visible_vram_size;
-	int r;
 
  	adev->fw_vram_usage.va = NULL;
  	adev->fw_vram_usage.reserved_bo = NULL;

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c static int amdgpu_ttm_fw_reserve_vram_init(struct amdgpu_device *adev) · line 1655

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0 -1
@@ -1651,7 +1650,6 @@ static int amdgpu_ttm_fw_reserve_vram_init(struct amdgpu_device *adev)
  					  AMDGPU_GEM_DOMAIN_VRAM,
  					  &adev->fw_vram_usage.reserved_bo,
  					  &adev->fw_vram_usage.va);
-	return r;
  }
 
  /**

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Applied
#2 lore raw
Quoted 4 lines · Christian

Am 03.10.19 um 23:40 schrieb Colin King:

Quoted 2 lines

From: Colin Ian King <[email protected]>

Quoted 8 lines
Quoted 6 lines

There is a return statement that is not reachable and a variable that is not used. Remove them.

Addresses-Coverity: ("Structurally dead code")

Fixes de7b45babd9b ("drm/amdgpu: cleanup creating BOs at fixed location (v2)")

Applied. Thanks!

Alex

Quoted 30 lines
Quoted 18 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 --
  1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0 -1
index 481e4c381083..814159f15633 100644
@@ -1636,7 +1636,6 @@ static void amdgpu_ttm_fw_reserve_vram_fini(struct amdgpu_device *adev)
  static int amdgpu_ttm_fw_reserve_vram_init(struct amdgpu_device *adev)
  {
      uint64_t vram_size = adev->gmc.visible_vram_size;
-     int r;
 
      adev->fw_vram_usage.va = NULL;
      adev->fw_vram_usage.reserved_bo = NULL;

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c static int amdgpu_ttm_fw_reserve_vram_init(struct amdgpu_device *adev) · line 1655

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0 -1
@@ -1651,7 +1650,6 @@ static int amdgpu_ttm_fw_reserve_vram_init(struct amdgpu_device *adev)
                                        AMDGPU_GEM_DOMAIN_VRAM,
                                        &adev->fw_vram_usage.reserved_bo,
                                        &adev->fw_vram_usage.va);
-     return r;
  }
 
  /**

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel