dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] drm/nouveau: remove some set but not used variables
@ 2019-11-15 13:42 zhengbin
  2019-11-15 13:42 ` zhengbin
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: zhengbin @ 2019-11-15 13:42 UTC (permalink / raw)
  To: bskeggs, lyude, airlied, daniel, dri-devel, nouveau; +Cc: zhengbin13

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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 0/2] drm/nouveau: remove some set but not used variables
  2019-11-15 13:42 [PATCH 0/2] drm/nouveau: remove some set but not used variables zhengbin
@ 2019-11-15 13:42 ` zhengbin
  2019-11-15 13:42 ` [PATCH 1/2] drm/nouveau: remove set but not used variable 'pclks', 'width' zhengbin
  2019-11-15 13:42 ` [PATCH 2/2] drm/nouveau: remove set but not used variable 'mem' zhengbin
  2 siblings, 0 replies; 10+ messages in thread
From: zhengbin @ 2019-11-15 13:42 UTC (permalink / raw)
  To: bskeggs, lyude, airlied, daniel, dri-devel, nouveau; +Cc: zhengbin13

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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 1/2] drm/nouveau: remove set but not used variable 'pclks', 'width'
  2019-11-15 13:42 [PATCH 0/2] drm/nouveau: remove some set but not used variables zhengbin
  2019-11-15 13:42 ` zhengbin
@ 2019-11-15 13:42 ` zhengbin
  2019-11-15 13:42   ` zhengbin
       [not found]   ` <1573825353-86268-2-git-send-email-zhengbin13-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
  2019-11-15 13:42 ` [PATCH 2/2] drm/nouveau: remove set but not used variable 'mem' zhengbin
  2 siblings, 2 replies; 10+ messages in thread
From: zhengbin @ 2019-11-15 13:42 UTC (permalink / raw)
  To: bskeggs, lyude, airlied, daniel, dri-devel, nouveau; +Cc: zhengbin13

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@huawei.com>
Signed-off-by: zhengbin <zhengbin13@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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 1/2] drm/nouveau: remove set but not used variable 'pclks', 'width'
  2019-11-15 13:42 ` [PATCH 1/2] drm/nouveau: remove set but not used variable 'pclks', 'width' zhengbin
@ 2019-11-15 13:42   ` zhengbin
       [not found]   ` <1573825353-86268-2-git-send-email-zhengbin13-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
  1 sibling, 0 replies; 10+ messages in thread
From: zhengbin @ 2019-11-15 13:42 UTC (permalink / raw)
  To: bskeggs, lyude, airlied, daniel, dri-devel, nouveau; +Cc: zhengbin13

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@huawei.com>
Signed-off-by: zhengbin <zhengbin13@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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 2/2] drm/nouveau: remove set but not used variable 'mem'
  2019-11-15 13:42 [PATCH 0/2] drm/nouveau: remove some set but not used variables zhengbin
  2019-11-15 13:42 ` zhengbin
  2019-11-15 13:42 ` [PATCH 1/2] drm/nouveau: remove set but not used variable 'pclks', 'width' zhengbin
@ 2019-11-15 13:42 ` zhengbin
  2019-11-15 13:42   ` zhengbin
  2019-11-15 18:00   ` Lyude Paul
  2 siblings, 2 replies; 10+ messages in thread
From: zhengbin @ 2019-11-15 13:42 UTC (permalink / raw)
  To: bskeggs, lyude, airlied, daniel, dri-devel, nouveau; +Cc: zhengbin13

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@huawei.com>
Signed-off-by: zhengbin <zhengbin13@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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 2/2] drm/nouveau: remove set but not used variable 'mem'
  2019-11-15 13:42 ` [PATCH 2/2] drm/nouveau: remove set but not used variable 'mem' zhengbin
@ 2019-11-15 13:42   ` zhengbin
  2019-11-15 18:00   ` Lyude Paul
  1 sibling, 0 replies; 10+ messages in thread
From: zhengbin @ 2019-11-15 13:42 UTC (permalink / raw)
  To: bskeggs, lyude, airlied, daniel, dri-devel, nouveau; +Cc: zhengbin13

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@huawei.com>
Signed-off-by: zhengbin <zhengbin13@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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH 1/2] drm/nouveau: remove set but not used variable 'pclks', 'width'
       [not found]   ` <1573825353-86268-2-git-send-email-zhengbin13-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
@ 2019-11-15 17:59     ` Lyude Paul
  2019-11-15 17:59       ` [PATCH 1/2] drm/nouveau: remove set but not used variable 'pclks','width' Lyude Paul
  0 siblings, 1 reply; 10+ messages in thread
From: Lyude Paul @ 2019-11-15 17:59 UTC (permalink / raw)
  To: zhengbin, bskeggs-H+wXaHxf7aLQT0dZR+AlfA, airlied-cv59FeDIM0c,
	daniel-/w4YWyX8dFk, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Reviewed-by: Lyude Paul <lyude@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@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@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

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

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

* Re: [PATCH 1/2] drm/nouveau: remove set but not used variable 'pclks','width'
  2019-11-15 17:59     ` Lyude Paul
@ 2019-11-15 17:59       ` Lyude Paul
  0 siblings, 0 replies; 10+ messages in thread
From: Lyude Paul @ 2019-11-15 17:59 UTC (permalink / raw)
  To: zhengbin, bskeggs, airlied, daniel, dri-devel, nouveau

Reviewed-by: Lyude Paul <lyude@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@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH 2/2] drm/nouveau: remove set but not used variable 'mem'
  2019-11-15 13:42 ` [PATCH 2/2] drm/nouveau: remove set but not used variable 'mem' zhengbin
  2019-11-15 13:42   ` zhengbin
@ 2019-11-15 18:00   ` Lyude Paul
  2019-11-15 18:00     ` Lyude Paul
  1 sibling, 1 reply; 10+ messages in thread
From: Lyude Paul @ 2019-11-15 18:00 UTC (permalink / raw)
  To: zhengbin, bskeggs, airlied, daniel, dri-devel, nouveau

Reviewed-by: Lyude Paul <lyude@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@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH 2/2] drm/nouveau: remove set but not used variable 'mem'
  2019-11-15 18:00   ` Lyude Paul
@ 2019-11-15 18:00     ` Lyude Paul
  0 siblings, 0 replies; 10+ messages in thread
From: Lyude Paul @ 2019-11-15 18:00 UTC (permalink / raw)
  To: zhengbin, bskeggs, airlied, daniel, dri-devel, nouveau

Reviewed-by: Lyude Paul <lyude@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@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2019-11-17 11:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-15 13:42 [PATCH 0/2] drm/nouveau: remove some set but not used variables zhengbin
2019-11-15 13:42 ` zhengbin
2019-11-15 13:42 ` [PATCH 1/2] drm/nouveau: remove set but not used variable 'pclks', 'width' zhengbin
2019-11-15 13:42   ` zhengbin
     [not found]   ` <1573825353-86268-2-git-send-email-zhengbin13-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2019-11-15 17:59     ` Lyude Paul
2019-11-15 17:59       ` [PATCH 1/2] drm/nouveau: remove set but not used variable 'pclks','width' Lyude Paul
2019-11-15 13:42 ` [PATCH 2/2] drm/nouveau: remove set but not used variable 'mem' zhengbin
2019-11-15 13:42   ` zhengbin
2019-11-15 18:00   ` Lyude Paul
2019-11-15 18:00     ` Lyude Paul

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 NNTP newsgroup(s).