LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/radeon: remove unused variable rbo
@ 2023-03-14 13:06 Tom Rix
  2023-03-14 13:08 ` Christian König
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Rix @ 2023-03-14 13:06 UTC (permalink / raw
  To: alexander.deucher, christian.koenig, Xinhui.Pan, airlied, daniel
  Cc: amd-gfx, dri-devel, linux-kernel, 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>
---
 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)) {
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/radeon: remove unused variable rbo
  2023-03-14 13:06 Tom Rix
@ 2023-03-14 13:08 ` Christian König
  0 siblings, 0 replies; 3+ messages in thread
From: Christian König @ 2023-03-14 13:08 UTC (permalink / raw
  To: Tom Rix, alexander.deucher, Xinhui.Pan, airlied, daniel
  Cc: amd-gfx, dri-devel, linux-kernel

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)) {


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] drm/radeon: remove unused variable rbo
@ 2023-05-25 21:00 Tom Rix
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Rix @ 2023-05-25 21:00 UTC (permalink / raw
  To: alexander.deucher, christian.koenig, Xinhui.Pan, airlied, daniel
  Cc: amd-gfx, dri-devel, linux-kernel, Tom Rix

gcc with W=1 reports
drivers/gpu/drm/radeon/radeon_ttm.c:200:27: error: variable
  ‘rbo’ set but not used [-Werror=unused-but-set-variable]
  200 |         struct radeon_bo *rbo;
      |                           ^~~
This variable is not used so remove it.

Signed-off-by: Tom Rix <trix@redhat.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 4eb83ccc4906..de4e6d78f1e1 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -197,7 +197,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) {
@@ -210,7 +209,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)) {
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-25 21:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-25 21:00 [PATCH] drm/radeon: remove unused variable rbo Tom Rix
  -- strict thread matches above, loose matches on Subject: below --
2023-03-14 13:06 Tom Rix
2023-03-14 13:08 ` Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).