diff mbox series

[-next] drm/ttm/agp: Fix Wunused-variable warning

Message ID 20200910023345.20428-1-yuehaibing@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] drm/ttm/agp: Fix Wunused-variable warning | expand

Commit Message

Yue Haibing Sept. 10, 2020, 2:33 a.m. UTC
If CONFIG_AGP is not set, gcc warns:

drivers/gpu/drm/radeon/radeon_ttm.c: In function ‘radeon_ttm_tt_bind’:
drivers/gpu/drm/radeon/radeon_ttm.c:692:24: warning: unused variable ‘rdev’ [-Wunused-variable]
  struct radeon_device *rdev = radeon_get_rdev(bdev);
                        ^~~~

Move it to ifdef block to fix this.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christian König Sept. 10, 2020, 8:56 a.m. UTC | #1
Am 10.09.20 um 04:33 schrieb YueHaibing:
> If CONFIG_AGP is not set, gcc warns:
>
> drivers/gpu/drm/radeon/radeon_ttm.c: In function ‘radeon_ttm_tt_bind’:
> drivers/gpu/drm/radeon/radeon_ttm.c:692:24: warning: unused variable ‘rdev’ [-Wunused-variable]
>    struct radeon_device *rdev = radeon_get_rdev(bdev);
>                          ^~~~
>
> Move it to ifdef block to fix this.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
> index 31c63d339629..449e77eb75f9 100644
> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> @@ -689,9 +689,9 @@ static int radeon_ttm_tt_bind(struct ttm_bo_device *bdev,
>   			      struct ttm_tt *ttm,
>   			      struct ttm_resource *bo_mem)
>   {
> +#if IS_ENABLED(CONFIG_AGP)
>   	struct radeon_device *rdev = radeon_get_rdev(bdev);
>   
> -#if IS_ENABLED(CONFIG_AGP)
>   	if (rdev->flags & RADEON_IS_AGP)
>   		return ttm_agp_bind(ttm, bo_mem);
>   #endif
Alex Deucher Sept. 15, 2020, 7:28 p.m. UTC | #2
This function no longer exists.

Alex

On Thu, Sep 10, 2020 at 4:56 AM Christian König
<christian.koenig@amd.com> wrote:
>
> Am 10.09.20 um 04:33 schrieb YueHaibing:
> > If CONFIG_AGP is not set, gcc warns:
> >
> > drivers/gpu/drm/radeon/radeon_ttm.c: In function ‘radeon_ttm_tt_bind’:
> > drivers/gpu/drm/radeon/radeon_ttm.c:692:24: warning: unused variable ‘rdev’ [-Wunused-variable]
> >    struct radeon_device *rdev = radeon_get_rdev(bdev);
> >                          ^~~~
> >
> > Move it to ifdef block to fix this.
> >
> > Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
>
> > ---
> >   drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
> > index 31c63d339629..449e77eb75f9 100644
> > --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> > +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> > @@ -689,9 +689,9 @@ static int radeon_ttm_tt_bind(struct ttm_bo_device *bdev,
> >                             struct ttm_tt *ttm,
> >                             struct ttm_resource *bo_mem)
> >   {
> > +#if IS_ENABLED(CONFIG_AGP)
> >       struct radeon_device *rdev = radeon_get_rdev(bdev);
> >
> > -#if IS_ENABLED(CONFIG_AGP)
> >       if (rdev->flags & RADEON_IS_AGP)
> >               return ttm_agp_bind(ttm, bo_mem);
> >   #endif
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 31c63d339629..449e77eb75f9 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -689,9 +689,9 @@  static int radeon_ttm_tt_bind(struct ttm_bo_device *bdev,
 			      struct ttm_tt *ttm,
 			      struct ttm_resource *bo_mem)
 {
+#if IS_ENABLED(CONFIG_AGP)
 	struct radeon_device *rdev = radeon_get_rdev(bdev);
 
-#if IS_ENABLED(CONFIG_AGP)
 	if (rdev->flags & RADEON_IS_AGP)
 		return ttm_agp_bind(ttm, bo_mem);
 #endif