drm/radeon: remove unused variable rbo

Message ID 20230314130616.2170856-1-trix@redhat.com
State New
Headers
Series drm/radeon: remove unused variable rbo |

Commit Message

Tom Rix March 14, 2023, 1:06 p.m. UTC
  gcc with W=1 reports this error
drivers/gpu/drm/radeon/radeon_ttm.c:201:27: error:
  variable ‘rbo’ set but not used [-Werror=unused-but-set-variable]
  201 |         struct radeon_bo *rbo;
      |                           ^~~

rbo use was removed with
commit f87c1f0b7b79 ("drm/ttm: prevent moving of pinned BOs")
Since the variable is not used, remove it.

Signed-off-by: Tom Rix <trix@redhat.com>
---
 drivers/gpu/drm/radeon/radeon_ttm.c | 2 --
 1 file changed, 2 deletions(-)
  

Comments

Christian König March 14, 2023, 1:08 p.m. UTC | #1
Am 14.03.23 um 14:06 schrieb Tom Rix:
> gcc with W=1 reports this error
> drivers/gpu/drm/radeon/radeon_ttm.c:201:27: error:
>    variable ‘rbo’ set but not used [-Werror=unused-but-set-variable]
>    201 |         struct radeon_bo *rbo;
>        |                           ^~~
>
> rbo use was removed with
> commit f87c1f0b7b79 ("drm/ttm: prevent moving of pinned BOs")
> Since the variable is not used, remove it.
>
> Signed-off-by: Tom Rix <trix@redhat.com>

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

> ---
>   drivers/gpu/drm/radeon/radeon_ttm.c | 2 --
>   1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
> index 2220cdf6a3f6..0ea430ee5256 100644
> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> @@ -198,7 +198,6 @@ static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict,
>   {
>   	struct ttm_resource *old_mem = bo->resource;
>   	struct radeon_device *rdev;
> -	struct radeon_bo *rbo;
>   	int r;
>   
>   	if (new_mem->mem_type == TTM_PL_TT) {
> @@ -211,7 +210,6 @@ static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict,
>   	if (r)
>   		return r;
>   
> -	rbo = container_of(bo, struct radeon_bo, tbo);
>   	rdev = radeon_get_rdev(bo->bdev);
>   	if (!old_mem || (old_mem->mem_type == TTM_PL_SYSTEM &&
>   			 bo->ttm == NULL)) {
  

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 2220cdf6a3f6..0ea430ee5256 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -198,7 +198,6 @@  static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict,
 {
 	struct ttm_resource *old_mem = bo->resource;
 	struct radeon_device *rdev;
-	struct radeon_bo *rbo;
 	int r;
 
 	if (new_mem->mem_type == TTM_PL_TT) {
@@ -211,7 +210,6 @@  static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict,
 	if (r)
 		return r;
 
-	rbo = container_of(bo, struct radeon_bo, tbo);
 	rdev = radeon_get_rdev(bo->bdev);
 	if (!old_mem || (old_mem->mem_type == TTM_PL_SYSTEM &&
 			 bo->ttm == NULL)) {