dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] drm/amdgpu: remove set but not used variable 'adev'
@ 2020-07-02  1:55 YueHaibing
  2020-07-06 16:06 ` Alex Deucher
  0 siblings, 1 reply; 5+ messages in thread
From: YueHaibing @ 2020-07-02  1:55 UTC (permalink / raw)
  To: Alex Deucher, christian.koenig, airlied, daniel, sumit.semwal,
	tianci.yin, kraxel, Likun.Gao, Felix.Kuehling, jgg,
	Hawking.Zhang
  Cc: YueHaibing, kernel-janitors, dri-devel, linaro-mm-sig, amd-gfx,
	linux-media

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

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c: In function 'amdgpu_init_mem_type':
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:81:24: warning:
 variable 'adev' set but not used [-Wunused-but-set-variable]
  struct amdgpu_device *adev;
                        ^

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index bb95627ad2cc..8199702d3354 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -78,10 +78,6 @@
 static int amdgpu_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
 				struct ttm_mem_type_manager *man)
 {
-	struct amdgpu_device *adev;
-
-	adev = amdgpu_ttm_adev(bdev);
-
 	switch (type) {
 	case TTM_PL_SYSTEM:
 		/* System memory */





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

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

* Re: [PATCH -next] drm/amdgpu: remove set but not used variable 'adev'
  2020-07-02  1:55 [PATCH -next] drm/amdgpu: remove set but not used variable 'adev' YueHaibing
@ 2020-07-06 16:06 ` Alex Deucher
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2020-07-06 16:06 UTC (permalink / raw)
  To: YueHaibing
  Cc: amd-gfx list, Dave Airlie, Kuehling, Felix, tiancyin,
	kernel-janitors, Maling list - DRI developers,
	moderated list:DMA BUFFER SHARING FRAMEWORK, Jason Gunthorpe,
	Gerd Hoffmann, Alex Deucher, Likun Gao, linux-media,
	Christian Koenig, Hawking Zhang

On Thu, Jul 2, 2020 at 3:25 AM YueHaibing <yuehaibing@huawei.com> wrote:
>
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c: In function 'amdgpu_init_mem_type':
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:81:24: warning:
>  variable 'adev' set but not used [-Wunused-but-set-variable]
>   struct amdgpu_device *adev;
>                         ^
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

With our current -next tree, this patch is no longer applicable.

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index bb95627ad2cc..8199702d3354 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -78,10 +78,6 @@
>  static int amdgpu_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
>                                 struct ttm_mem_type_manager *man)
>  {
> -       struct amdgpu_device *adev;
> -
> -       adev = amdgpu_ttm_adev(bdev);
> -
>         switch (type) {
>         case TTM_PL_SYSTEM:
>                 /* System memory */
>
>
>
>
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH -next] drm/amdgpu: remove set but not used variable 'adev'
  2019-10-23  7:58 YueHaibing
@ 2019-10-28 17:38 ` Alex Deucher
  2019-10-28 17:38   ` Alex Deucher
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Deucher @ 2019-10-28 17:38 UTC (permalink / raw)
  To: YueHaibing
  Cc: Deucher, Alexander, Christian Koenig, Chunming Zhou, Dave Airlie,
	Daniel Vetter, Kuehling, Felix, Yang, Philip, Jason Gunthorpe,
	Gerd Hoffmann, Thomas Zimmermann, tiancyin,
	Maling list - DRI developers, amd-gfx list, LKML

On Wed, Oct 23, 2019 at 4:10 AM YueHaibing <yuehaibing@huawei.com> wrote:
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1221:24: warning: variable adev set but not used [-Wunused-but-set-variable]
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:488:24: warning: variable adev set but not used [-Wunused-but-set-variable]
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:547:24: warning: variable adev set but not used [-Wunused-but-set-variable]
>
> It is never used, so can removed it.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Applied.  thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 9 ---------
>  1 file changed, 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index a61b0d9..ba00262 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -485,15 +485,12 @@ static int amdgpu_move_vram_ram(struct ttm_buffer_object *bo, bool evict,
>                                 struct ttm_operation_ctx *ctx,
>                                 struct ttm_mem_reg *new_mem)
>  {
> -       struct amdgpu_device *adev;
>         struct ttm_mem_reg *old_mem = &bo->mem;
>         struct ttm_mem_reg tmp_mem;
>         struct ttm_place placements;
>         struct ttm_placement placement;
>         int r;
>
> -       adev = amdgpu_ttm_adev(bo->bdev);
> -
>         /* create space/pages for new_mem in GTT space */
>         tmp_mem = *new_mem;
>         tmp_mem.mm_node = NULL;
> @@ -544,15 +541,12 @@ static int amdgpu_move_ram_vram(struct ttm_buffer_object *bo, bool evict,
>                                 struct ttm_operation_ctx *ctx,
>                                 struct ttm_mem_reg *new_mem)
>  {
> -       struct amdgpu_device *adev;
>         struct ttm_mem_reg *old_mem = &bo->mem;
>         struct ttm_mem_reg tmp_mem;
>         struct ttm_placement placement;
>         struct ttm_place placements;
>         int r;
>
> -       adev = amdgpu_ttm_adev(bo->bdev);
> -
>         /* make space in GTT for old_mem buffer */
>         tmp_mem = *new_mem;
>         tmp_mem.mm_node = NULL;
> @@ -1218,11 +1212,8 @@ static struct ttm_backend_func amdgpu_backend_func = {
>  static struct ttm_tt *amdgpu_ttm_tt_create(struct ttm_buffer_object *bo,
>                                            uint32_t page_flags)
>  {
> -       struct amdgpu_device *adev;
>         struct amdgpu_ttm_tt *gtt;
>
> -       adev = amdgpu_ttm_adev(bo->bdev);
> -
>         gtt = kzalloc(sizeof(struct amdgpu_ttm_tt), GFP_KERNEL);
>         if (gtt == NULL) {
>                 return NULL;
> --
> 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] 5+ messages in thread

* Re: [PATCH -next] drm/amdgpu: remove set but not used variable 'adev'
  2019-10-28 17:38 ` Alex Deucher
@ 2019-10-28 17:38   ` Alex Deucher
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2019-10-28 17:38 UTC (permalink / raw)
  To: YueHaibing
  Cc: amd-gfx list, Thomas Zimmermann, Yang, Philip, Dave Airlie,
	Kuehling, Felix, tiancyin, LKML, Maling list - DRI developers,
	Jason Gunthorpe, Gerd Hoffmann, Deucher, Alexander,
	Christian Koenig

On Wed, Oct 23, 2019 at 4:10 AM YueHaibing <yuehaibing@huawei.com> wrote:
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1221:24: warning: variable adev set but not used [-Wunused-but-set-variable]
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:488:24: warning: variable adev set but not used [-Wunused-but-set-variable]
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:547:24: warning: variable adev set but not used [-Wunused-but-set-variable]
>
> It is never used, so can removed it.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Applied.  thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 9 ---------
>  1 file changed, 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index a61b0d9..ba00262 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -485,15 +485,12 @@ static int amdgpu_move_vram_ram(struct ttm_buffer_object *bo, bool evict,
>                                 struct ttm_operation_ctx *ctx,
>                                 struct ttm_mem_reg *new_mem)
>  {
> -       struct amdgpu_device *adev;
>         struct ttm_mem_reg *old_mem = &bo->mem;
>         struct ttm_mem_reg tmp_mem;
>         struct ttm_place placements;
>         struct ttm_placement placement;
>         int r;
>
> -       adev = amdgpu_ttm_adev(bo->bdev);
> -
>         /* create space/pages for new_mem in GTT space */
>         tmp_mem = *new_mem;
>         tmp_mem.mm_node = NULL;
> @@ -544,15 +541,12 @@ static int amdgpu_move_ram_vram(struct ttm_buffer_object *bo, bool evict,
>                                 struct ttm_operation_ctx *ctx,
>                                 struct ttm_mem_reg *new_mem)
>  {
> -       struct amdgpu_device *adev;
>         struct ttm_mem_reg *old_mem = &bo->mem;
>         struct ttm_mem_reg tmp_mem;
>         struct ttm_placement placement;
>         struct ttm_place placements;
>         int r;
>
> -       adev = amdgpu_ttm_adev(bo->bdev);
> -
>         /* make space in GTT for old_mem buffer */
>         tmp_mem = *new_mem;
>         tmp_mem.mm_node = NULL;
> @@ -1218,11 +1212,8 @@ static struct ttm_backend_func amdgpu_backend_func = {
>  static struct ttm_tt *amdgpu_ttm_tt_create(struct ttm_buffer_object *bo,
>                                            uint32_t page_flags)
>  {
> -       struct amdgpu_device *adev;
>         struct amdgpu_ttm_tt *gtt;
>
> -       adev = amdgpu_ttm_adev(bo->bdev);
> -
>         gtt = kzalloc(sizeof(struct amdgpu_ttm_tt), GFP_KERNEL);
>         if (gtt == NULL) {
>                 return NULL;
> --
> 2.7.4
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH -next] drm/amdgpu: remove set but not used variable 'adev'
@ 2019-10-23  7:58 YueHaibing
  2019-10-28 17:38 ` Alex Deucher
  0 siblings, 1 reply; 5+ messages in thread
From: YueHaibing @ 2019-10-23  7:58 UTC (permalink / raw)
  To: alexander.deucher, christian.koenig, David1.Zhou, airlied,
	daniel, Felix.Kuehling, Philip.Yang, jgg, kraxel, tzimmermann,
	tianci.yin
  Cc: amd-gfx, dri-devel, linux-kernel, YueHaibing

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1221:24: warning: variable adev set but not used [-Wunused-but-set-variable]
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:488:24: warning: variable adev set but not used [-Wunused-but-set-variable]
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:547:24: warning: variable adev set but not used [-Wunused-but-set-variable]

It is never used, so can removed it.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index a61b0d9..ba00262 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -485,15 +485,12 @@ static int amdgpu_move_vram_ram(struct ttm_buffer_object *bo, bool evict,
 				struct ttm_operation_ctx *ctx,
 				struct ttm_mem_reg *new_mem)
 {
-	struct amdgpu_device *adev;
 	struct ttm_mem_reg *old_mem = &bo->mem;
 	struct ttm_mem_reg tmp_mem;
 	struct ttm_place placements;
 	struct ttm_placement placement;
 	int r;
 
-	adev = amdgpu_ttm_adev(bo->bdev);
-
 	/* create space/pages for new_mem in GTT space */
 	tmp_mem = *new_mem;
 	tmp_mem.mm_node = NULL;
@@ -544,15 +541,12 @@ static int amdgpu_move_ram_vram(struct ttm_buffer_object *bo, bool evict,
 				struct ttm_operation_ctx *ctx,
 				struct ttm_mem_reg *new_mem)
 {
-	struct amdgpu_device *adev;
 	struct ttm_mem_reg *old_mem = &bo->mem;
 	struct ttm_mem_reg tmp_mem;
 	struct ttm_placement placement;
 	struct ttm_place placements;
 	int r;
 
-	adev = amdgpu_ttm_adev(bo->bdev);
-
 	/* make space in GTT for old_mem buffer */
 	tmp_mem = *new_mem;
 	tmp_mem.mm_node = NULL;
@@ -1218,11 +1212,8 @@ static struct ttm_backend_func amdgpu_backend_func = {
 static struct ttm_tt *amdgpu_ttm_tt_create(struct ttm_buffer_object *bo,
 					   uint32_t page_flags)
 {
-	struct amdgpu_device *adev;
 	struct amdgpu_ttm_tt *gtt;
 
-	adev = amdgpu_ttm_adev(bo->bdev);
-
 	gtt = kzalloc(sizeof(struct amdgpu_ttm_tt), GFP_KERNEL);
 	if (gtt == NULL) {
 		return NULL;
-- 
2.7.4

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

end of thread, other threads:[~2020-07-06 16:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-02  1:55 [PATCH -next] drm/amdgpu: remove set but not used variable 'adev' YueHaibing
2020-07-06 16:06 ` Alex Deucher
  -- strict thread matches above, loose matches on Subject: below --
2019-10-23  7:58 YueHaibing
2019-10-28 17:38 ` Alex Deucher
2019-10-28 17:38   ` Alex Deucher

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).