Skip to contentSkip to conversation

drm/nouveau: Remove set but not used variable 'dev'

PATCH In review Baokun Li 2 participants 3 messages May 25, 2021 – Jun 15, 2021

Subsystems (4)
lore
Share & tools
lore

Baokun Li

author
#0 lore raw

PATCH 1/1 drm/nouveau: Remove set but not used variable 'dev'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/nouveau/nouveau_bo.c: In function 'nouveau_ttm_tt_populate':
drivers/gpu/drm/nouveau/nouveau_bo.c:1258:17: warning:
variable ‘dev’ set but not used [-Wunused-but-set-variable]

drivers/gpu/drm/nouveau/nouveau_bo.c: In function 'nouveau_ttm_tt_unpopulate':
drivers/gpu/drm/nouveau/nouveau_bo.c:1281:17: warning:
variable ‘dev’ set but not used [-Wunused-but-set-variable]

It never used since introduction.

---
 drivers/gpu/drm/nouveau/nouveau_bo.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/gpu/drm/nouveau/nouveau_bo.c +0 -4
index 7a2624c0ba4c..51f9a2e6532e 100644
@@ -1254,7 +1254,6 @@ nouveau_ttm_tt_populate(struct ttm_device *bdev,
 {
 	struct ttm_tt *ttm_dma = (void *)ttm;
 	struct nouveau_drm *drm;
-	struct device *dev;
 	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
 
 	if (ttm_tt_is_populated(ttm))
@@ -1267,7 +1266,6 @@ nouveau_ttm_tt_populate(struct ttm_device *bdev,
 	}
 
 	drm = nouveau_bdev(bdev);
-	dev = drm->dev->dev;
 
 	return ttm_pool_alloc(&drm->ttm.bdev.pool, ttm, ctx);
 }
@@ -1277,14 +1275,12 @@ nouveau_ttm_tt_unpopulate(struct ttm_device *bdev,
 			  struct ttm_tt *ttm)
 {
 	struct nouveau_drm *drm;
-	struct device *dev;
 	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
 
 	if (slave)
 		return;
 
 	drm = nouveau_bdev(bdev);
-	dev = drm->dev->dev;
 
 	return ttm_pool_free(&drm->ttm.bdev.pool, ttm);
 }
Signature · 1 line
2.25.4
#1 lore raw

ping

Quoted 52 lines · Baokun Li

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/nouveau/nouveau_bo.c: In function 'nouveau_ttm_tt_populate':
drivers/gpu/drm/nouveau/nouveau_bo.c:1258:17: warning:
variable ‘dev’ set but not used [-Wunused-but-set-variable]

drivers/gpu/drm/nouveau/nouveau_bo.c: In function 'nouveau_ttm_tt_unpopulate':
drivers/gpu/drm/nouveau/nouveau_bo.c:1281:17: warning:
variable ‘dev’ set but not used [-Wunused-but-set-variable]

It never used since introduction.

---
  drivers/gpu/drm/nouveau/nouveau_bo.c | 4 ----
  1 file changed, 4 deletions(-)
drivers/gpu/drm/nouveau/nouveau_bo.c +0 -4
index 7a2624c0ba4c..51f9a2e6532e 100644
@@ -1254,7 +1254,6 @@ nouveau_ttm_tt_populate(struct ttm_device *bdev,
  {
  	struct ttm_tt *ttm_dma = (void *)ttm;
  	struct nouveau_drm *drm;
-	struct device *dev;
  	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
 
  	if (ttm_tt_is_populated(ttm))
@@ -1267,7 +1266,6 @@ nouveau_ttm_tt_populate(struct ttm_device *bdev,
  	}
 
  	drm = nouveau_bdev(bdev);
-	dev = drm->dev->dev;
 
  	return ttm_pool_alloc(&drm->ttm.bdev.pool, ttm, ctx);
  }
@@ -1277,14 +1275,12 @@ nouveau_ttm_tt_unpopulate(struct ttm_device *bdev,
  			  struct ttm_tt *ttm)
  {
  	struct nouveau_drm *drm;
-	struct device *dev;
  	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
 
  	if (slave)
  		return;
 
  	drm = nouveau_bdev(bdev);
-	dev = drm->dev->dev;
 
  	return ttm_pool_free(&drm->ttm.bdev.pool, ttm);
  }
Acked-by on v1 1/1
#2 lore raw
In reply to Baokun Li

Am 25.05.21 um 10:25 schrieb Baokun Li:

Quoted 6 lines

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/nouveau/nouveau_bo.c: In function 'nouveau_ttm_tt_populate':
drivers/gpu/drm/nouveau/nouveau_bo.c:1258:17: warning:
variable ‘dev’ set but not used [-Wunused-but-set-variable]

Quoted 7 lines

drivers/gpu/drm/nouveau/nouveau_bo.c: In function 'nouveau_ttm_tt_unpopulate':
drivers/gpu/drm/nouveau/nouveau_bo.c:1281:17: warning:
variable ‘dev’ set but not used [-Wunused-but-set-variable]

It never used since introduction.

Quoted 29 lines
---
  drivers/gpu/drm/nouveau/nouveau_bo.c | 4 ----
  1 file changed, 4 deletions(-)
drivers/gpu/drm/nouveau/nouveau_bo.c +0 -3
index 7a2624c0ba4c..51f9a2e6532e 100644
@@ -1254,7 +1254,6 @@ nouveau_ttm_tt_populate(struct ttm_device *bdev,
  {
  	struct ttm_tt *ttm_dma = (void *)ttm;
  	struct nouveau_drm *drm;
-	struct device *dev;
  	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
 
  	if (ttm_tt_is_populated(ttm))
@@ -1267,7 +1266,6 @@ nouveau_ttm_tt_populate(struct ttm_device *bdev,
  	}
 
  	drm = nouveau_bdev(bdev);
-	dev = drm->dev->dev;
 
  	return ttm_pool_alloc(&drm->ttm.bdev.pool, ttm, ctx);
  }
@@ -1277,14 +1275,12 @@ nouveau_ttm_tt_unpopulate(struct ttm_device *bdev,
  			  struct ttm_tt *ttm)
  {
  	struct nouveau_drm *drm;
-	struct device *dev;

drivers/gpu/drm/nouveau/nouveau_bo.c nouveau_ttm_tt_unpopulate(struct ttm_device *bdev, · line 1286

Quoted 10 lines
drivers/gpu/drm/nouveau/nouveau_bo.c +0 -1
  	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
 
  	if (slave)
  		return;
 
  	drm = nouveau_bdev(bdev);
-	dev = drm->dev->dev;
 
  	return ttm_pool_free(&drm->ttm.bdev.pool, ttm);
  }

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau