Skip to contentSkip to conversation

drm/ttm/agp: Fix Wunused-variable warning

PATCH In review YueHaibing 3 participants 3 messages Sep 10, 2020 – Sep 15, 2020

Subsystems (2)
lore
Share & tools
lore

YueHaibing

author
#0 lore raw

PATCH 1/1 drm/ttm/agp: Fix Wunused-variable warning

If CONFIG_AGP is not set, gcc warns:

drivers/gpu/drm/radeon/radeon_ttm.c: In function ‘radeon_ttm_tt_bind’:
drivers/gpu/drm/radeon/radeon_ttm.c:692:24: warning: unused variable ‘rdev’ [-Wunused-variable]

  struct radeon_device *rdev = radeon_get_rdev(bdev);
                        ^~~~

Move it to ifdef block to fix this.

---
 drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_ttm.c +1 -1
index 31c63d339629..449e77eb75f9 100644
@@ -689,9 +689,9 @@ static int radeon_ttm_tt_bind(struct ttm_bo_device *bdev,
 			      struct ttm_tt *ttm,
 			      struct ttm_resource *bo_mem)
 {
+#if IS_ENABLED(CONFIG_AGP)
 	struct radeon_device *rdev = radeon_get_rdev(bdev);
 
-#if IS_ENABLED(CONFIG_AGP)
 	if (rdev->flags & RADEON_IS_AGP)
 		return ttm_agp_bind(ttm, bo_mem);
 #endif
Signature · 1 line
2.17.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

Am 10.09.20 um 04:33 schrieb YueHaibing:

Quoted 10 lines

If CONFIG_AGP is not set, gcc warns:

drivers/gpu/drm/radeon/radeon_ttm.c: In function ‘radeon_ttm_tt_bind’:
drivers/gpu/drm/radeon/radeon_ttm.c:692:24: warning: unused variable ‘rdev’ [-Wunused-variable]

   struct radeon_device *rdev = radeon_get_rdev(bdev);
                         ^~~~

Move it to ifdef block to fix this.

Quoted 9 lines
---
  drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_ttm.c +0 -0
index 31c63d339629..449e77eb75f9 100644

drivers/gpu/drm/radeon/radeon_ttm.c static int radeon_ttm_tt_bind(struct ttm_bo_device *bdev, · line 697

Quoted 10 lines
drivers/gpu/drm/radeon/radeon_ttm.c +1 -1
@@ -689,9 +689,9 @@ static int radeon_ttm_tt_bind(struct ttm_bo_device *bdev,
  			      struct ttm_tt *ttm,
  			      struct ttm_resource *bo_mem)
  {
+#if IS_ENABLED(CONFIG_AGP)
  	struct radeon_device *rdev = radeon_get_rdev(bdev);
 
-#if IS_ENABLED(CONFIG_AGP)
  	if (rdev->flags & RADEON_IS_AGP)
  		return ttm_agp_bind(ttm, bo_mem);
  #endif

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

#2 lore raw

This function no longer exists.

Alex

Quoted 30 lines · Christian König

Am 10.09.20 um 04:33 schrieb YueHaibing:

Quoted 10 lines

If CONFIG_AGP is not set, gcc warns:

drivers/gpu/drm/radeon/radeon_ttm.c: In function ‘radeon_ttm_tt_bind’:
drivers/gpu/drm/radeon/radeon_ttm.c:692:24: warning: unused variable ‘rdev’ [-Wunused-variable]

   struct radeon_device *rdev = radeon_get_rdev(bdev);
                         ^~~~

Move it to ifdef block to fix this.

Quoted 15 lines
---
  drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_ttm.c +1 -0
index 31c63d339629..449e77eb75f9 100644
@@ -689,9 +689,9 @@ static int radeon_ttm_tt_bind(struct ttm_bo_device *bdev,
                            struct ttm_tt *ttm,
                            struct ttm_resource *bo_mem)
  {
+#if IS_ENABLED(CONFIG_AGP)
      struct radeon_device *rdev = radeon_get_rdev(bdev);
 
Quoted 9 lines

drivers/gpu/drm/radeon/radeon_ttm.c static int radeon_ttm_tt_bind(struct ttm_bo_device *bdev, · line 697

Quoted 4 lines
drivers/gpu/drm/radeon/radeon_ttm.c +0 -1
-#if IS_ENABLED(CONFIG_AGP)
      if (rdev->flags & RADEON_IS_AGP)
              return ttm_agp_bind(ttm, bo_mem);
  #endif

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

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