2021-06-22 12:59:38

by Cai,Huoqing

[permalink] [raw]
Subject: [PATCH] remove unused varialble "struct device *dev"

fix the warning- variable 'dev' set but not used

Signed-off-by: Cai Huoqing <[email protected]>
---
drivers/gpu/drm/nouveau/nouveau_bo.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 984721b..cb3ff4a 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -1242,7 +1242,6 @@ vm_fault_t nouveau_ttm_fault_reserve_notify(struct ttm_buffer_object *bo)
{
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))
@@ -1255,7 +1254,6 @@ vm_fault_t nouveau_ttm_fault_reserve_notify(struct ttm_buffer_object *bo)
}

drm = nouveau_bdev(bdev);
- dev = drm->dev->dev;

return ttm_pool_alloc(&drm->ttm.bdev.pool, ttm, ctx);
}
@@ -1265,14 +1263,12 @@ vm_fault_t nouveau_ttm_fault_reserve_notify(struct ttm_buffer_object *bo)
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);
}
--
1.8.3.1


2021-06-23 15:24:22

by Karol Herbst

[permalink] [raw]
Subject: Re: [PATCH] remove unused varialble "struct device *dev"

On Tue, Jun 22, 2021 at 5:14 PM Cai Huoqing <[email protected]> wrote:
>
> fix the warning- variable 'dev' set but not used
>

the patch title needs a prefix to indicate which subsystem it belongs
to. Check git log for examples.

With that fixed: Reviewed-by: Karol Herbst <[email protected]>

> Signed-off-by: Cai Huoqing <[email protected]>
> ---
> drivers/gpu/drm/nouveau/nouveau_bo.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
> index 984721b..cb3ff4a 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_bo.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
> @@ -1242,7 +1242,6 @@ vm_fault_t nouveau_ttm_fault_reserve_notify(struct ttm_buffer_object *bo)
> {
> 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))
> @@ -1255,7 +1254,6 @@ vm_fault_t nouveau_ttm_fault_reserve_notify(struct ttm_buffer_object *bo)
> }
>
> drm = nouveau_bdev(bdev);
> - dev = drm->dev->dev;
>
> return ttm_pool_alloc(&drm->ttm.bdev.pool, ttm, ctx);
> }
> @@ -1265,14 +1263,12 @@ vm_fault_t nouveau_ttm_fault_reserve_notify(struct ttm_buffer_object *bo)
> 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);
> }
> --
> 1.8.3.1
>