zhengbin
2019-Nov-15 13:35 UTC
[Nouveau] [PATCH 0/2] drm/nouveau: remove some set but not used variables
zhengbin (2): drm/nouveau: remove set but not used variable 'pclks','width' drm/nouveau: remove set but not used variable 'mem' drivers/gpu/drm/nouveau/dispnv04/arb.c | 6 ++---- drivers/gpu/drm/nouveau/nouveau_ttm.c | 4 ---- 2 files changed, 2 insertions(+), 8 deletions(-) -- 2.7.4
zhengbin
2019-Nov-15 13:35 UTC
[Nouveau] [PATCH 1/2] drm/nouveau: remove set but not used variable 'pclks', 'width'
Fixes gcc '-Wunused-but-set-variable' warning: drivers/gpu/drm/nouveau/dispnv04/arb.c: In function nv04_calc_arb: drivers/gpu/drm/nouveau/dispnv04/arb.c:59:21: warning: variable pclks set but not used [-Wunused-but-set-variable] drivers/gpu/drm/nouveau/dispnv04/arb.c: In function nv04_calc_arb: drivers/gpu/drm/nouveau/dispnv04/arb.c:58:21: warning: variable width set but not used [-Wunused-but-set-variable] It is introduced by commit 6ee738610f41 ("drm/nouveau: Add DRM driver for NVIDIA GPUs"), but never used, so remove it. Reported-by: Hulk Robot <hulkci at huawei.com> Signed-off-by: zhengbin <zhengbin13 at huawei.com> --- drivers/gpu/drm/nouveau/dispnv04/arb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv04/arb.c b/drivers/gpu/drm/nouveau/dispnv04/arb.c index 3624955..9d4a2d9 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/arb.c +++ b/drivers/gpu/drm/nouveau/dispnv04/arb.c @@ -53,8 +53,8 @@ struct nv_sim_state { static void nv04_calc_arb(struct nv_fifo_info *fifo, struct nv_sim_state *arb) { - int pagemiss, cas, width, bpp; - int nvclks, mclks, pclks, crtpagemiss; + int pagemiss, cas, bpp; + int nvclks, mclks, crtpagemiss; int found, mclk_extra, mclk_loop, cbs, m1, p1; int mclk_freq, pclk_freq, nvclk_freq; int us_m, us_n, us_p, crtc_drain_rate; @@ -65,11 +65,9 @@ nv04_calc_arb(struct nv_fifo_info *fifo, struct nv_sim_state *arb) nvclk_freq = arb->nvclk_khz; pagemiss = arb->mem_page_miss; cas = arb->mem_latency; - width = arb->memory_width >> 6; bpp = arb->bpp; cbs = 128; - pclks = 2; nvclks = 10; mclks = 13 + cas; mclk_extra = 3; -- 2.7.4
zhengbin
2019-Nov-15 13:35 UTC
[Nouveau] [PATCH 2/2] drm/nouveau: remove set but not used variable 'mem'
Fixes gcc '-Wunused-but-set-variable' warning: drivers/gpu/drm/nouveau/nouveau_ttm.c: In function nouveau_vram_manager_new: drivers/gpu/drm/nouveau/nouveau_ttm.c:66:22: warning: variable mem set but not used [-Wunused-but-set-variable] drivers/gpu/drm/nouveau/nouveau_ttm.c: In function nouveau_gart_manager_new: drivers/gpu/drm/nouveau/nouveau_ttm.c:106:22: warning: variable mem set but not used [-Wunused-but-set-variable] The first 'mem' is introduced by commit 9ce523cc3bf2 ("drm/nouveau: separate buffer object backing memory from nvkm structures"), but never used, so remove it. The second 'mem' is not used since commit d7722134b825 ("drm/nouveau: switch over to new memory and vmm interfaces") Reported-by: Hulk Robot <hulkci at huawei.com> Signed-off-by: zhengbin <zhengbin13 at huawei.com> --- drivers/gpu/drm/nouveau/nouveau_ttm.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c index 77a0c6a..7ca0a24 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c @@ -63,14 +63,12 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man, { struct nouveau_bo *nvbo = nouveau_bo(bo); struct nouveau_drm *drm = nouveau_bdev(bo->bdev); - struct nouveau_mem *mem; int ret; if (drm->client.device.info.ram_size == 0) return -ENOMEM; ret = nouveau_mem_new(&drm->master, nvbo->kind, nvbo->comp, reg); - mem = nouveau_mem(reg); if (ret) return ret; @@ -103,11 +101,9 @@ nouveau_gart_manager_new(struct ttm_mem_type_manager *man, { struct nouveau_bo *nvbo = nouveau_bo(bo); struct nouveau_drm *drm = nouveau_bdev(bo->bdev); - struct nouveau_mem *mem; int ret; ret = nouveau_mem_new(&drm->master, nvbo->kind, nvbo->comp, reg); - mem = nouveau_mem(reg); if (ret) return ret; -- 2.7.4
Lyude Paul
2019-Nov-15 17:59 UTC
[Nouveau] [PATCH 1/2] drm/nouveau: remove set but not used variable 'pclks', 'width'
Reviewed-by: Lyude Paul <lyude at redhat.com> On Fri, 2019-11-15 at 21:42 +0800, zhengbin wrote:> Fixes gcc '-Wunused-but-set-variable' warning: > > drivers/gpu/drm/nouveau/dispnv04/arb.c: In function nv04_calc_arb: > drivers/gpu/drm/nouveau/dispnv04/arb.c:59:21: warning: variable pclks set > but not used [-Wunused-but-set-variable] > drivers/gpu/drm/nouveau/dispnv04/arb.c: In function nv04_calc_arb: > drivers/gpu/drm/nouveau/dispnv04/arb.c:58:21: warning: variable width set > but not used [-Wunused-but-set-variable] > > It is introduced by commit 6ee738610f41 ("drm/nouveau: > Add DRM driver for NVIDIA GPUs"), but never used, > so remove it. > > Reported-by: Hulk Robot <hulkci at huawei.com> > Signed-off-by: zhengbin <zhengbin13 at huawei.com> > --- > drivers/gpu/drm/nouveau/dispnv04/arb.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/dispnv04/arb.c > b/drivers/gpu/drm/nouveau/dispnv04/arb.c > index 3624955..9d4a2d9 100644 > --- a/drivers/gpu/drm/nouveau/dispnv04/arb.c > +++ b/drivers/gpu/drm/nouveau/dispnv04/arb.c > @@ -53,8 +53,8 @@ struct nv_sim_state { > static void > nv04_calc_arb(struct nv_fifo_info *fifo, struct nv_sim_state *arb) > { > - int pagemiss, cas, width, bpp; > - int nvclks, mclks, pclks, crtpagemiss; > + int pagemiss, cas, bpp; > + int nvclks, mclks, crtpagemiss; > int found, mclk_extra, mclk_loop, cbs, m1, p1; > int mclk_freq, pclk_freq, nvclk_freq; > int us_m, us_n, us_p, crtc_drain_rate; > @@ -65,11 +65,9 @@ nv04_calc_arb(struct nv_fifo_info *fifo, struct > nv_sim_state *arb) > nvclk_freq = arb->nvclk_khz; > pagemiss = arb->mem_page_miss; > cas = arb->mem_latency; > - width = arb->memory_width >> 6; > bpp = arb->bpp; > cbs = 128; > > - pclks = 2; > nvclks = 10; > mclks = 13 + cas; > mclk_extra = 3; > -- > 2.7.4 >-- Cheers, Lyude Paul
Lyude Paul
2019-Nov-15 18:00 UTC
[Nouveau] [PATCH 2/2] drm/nouveau: remove set but not used variable 'mem'
Reviewed-by: Lyude Paul <lyude at redhat.com> On Fri, 2019-11-15 at 21:42 +0800, zhengbin wrote:> Fixes gcc '-Wunused-but-set-variable' warning: > > drivers/gpu/drm/nouveau/nouveau_ttm.c: In function nouveau_vram_manager_new: > drivers/gpu/drm/nouveau/nouveau_ttm.c:66:22: warning: variable mem set but > not used [-Wunused-but-set-variable] > drivers/gpu/drm/nouveau/nouveau_ttm.c: In function nouveau_gart_manager_new: > drivers/gpu/drm/nouveau/nouveau_ttm.c:106:22: warning: variable mem set but > not used [-Wunused-but-set-variable] > > The first 'mem' is introduced by commit 9ce523cc3bf2 ("drm/nouveau: > separate buffer object backing memory from nvkm structures"), > but never used, so remove it. > > The second 'mem' is not used since commit d7722134b825 ("drm/nouveau: > switch over to new memory and vmm interfaces") > > Reported-by: Hulk Robot <hulkci at huawei.com> > Signed-off-by: zhengbin <zhengbin13 at huawei.com> > --- > drivers/gpu/drm/nouveau/nouveau_ttm.c | 4 ---- > 1 file changed, 4 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c > b/drivers/gpu/drm/nouveau/nouveau_ttm.c > index 77a0c6a..7ca0a24 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c > +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c > @@ -63,14 +63,12 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager > *man, > { > struct nouveau_bo *nvbo = nouveau_bo(bo); > struct nouveau_drm *drm = nouveau_bdev(bo->bdev); > - struct nouveau_mem *mem; > int ret; > > if (drm->client.device.info.ram_size == 0) > return -ENOMEM; > > ret = nouveau_mem_new(&drm->master, nvbo->kind, nvbo->comp, reg); > - mem = nouveau_mem(reg); > if (ret) > return ret; > > @@ -103,11 +101,9 @@ nouveau_gart_manager_new(struct ttm_mem_type_manager > *man, > { > struct nouveau_bo *nvbo = nouveau_bo(bo); > struct nouveau_drm *drm = nouveau_bdev(bo->bdev); > - struct nouveau_mem *mem; > int ret; > > ret = nouveau_mem_new(&drm->master, nvbo->kind, nvbo->comp, reg); > - mem = nouveau_mem(reg); > if (ret) > return ret; > > -- > 2.7.4 >-- Cheers, Lyude Paul
Seemingly Similar Threads
- [PATCH 2/2] drm/nouveau: remove set but not used variable 'mem'
- [PATCH -next] drm/ttm: Remove set but not used variable 'mem'
- [PATCH AUTOSEL 5.5 358/542] drm/nouveau/drm/ttm: Remove set but not used variable 'mem'
- [PATCH AUTOSEL 5.4 312/459] drm/nouveau/drm/ttm: Remove set but not used variable 'mem'
- [PATCH AUTOSEL 4.19 171/252] drm/nouveau/drm/ttm: Remove set but not used variable 'mem'