summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon/radeon_ttm.c
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2020-11-13 00:06:52 -0500
committerAlex Deucher <alexander.deucher@amd.com>2020-11-13 00:09:56 -0500
commit92378a4b54c1a66b08da2cff3db1b9906c41f709 (patch)
tree649dcedb999bd907c6c479a92d3b9e1d16709deb /drivers/gpu/drm/radeon/radeon_ttm.c
parentd706d409d9848762bd89781b8cbb5d6b02413f5f (diff)
drm/radeon/radeon_ttm: Place declaration of 'rdev' in same clause as its use
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/radeon/radeon_ttm.c: In function ‘radeon_ttm_tt_create’: drivers/gpu/drm/radeon/radeon_ttm.c:611:24: warning: variable ‘rdev’ set but not used [-Wunused-but-set-variable] Cc: Alex Deucher <alexander.deucher@amd.com> Cc: "Christian König" <christian.koenig@amd.com> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Jerome Glisse <glisse@freedesktop.org> Cc: amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_ttm.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_ttm.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 95038ac3382e..e07fb1133407 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -608,20 +608,18 @@ static void radeon_ttm_backend_destroy(struct ttm_bo_device *bdev, struct ttm_tt
static struct ttm_tt *radeon_ttm_tt_create(struct ttm_buffer_object *bo,
uint32_t page_flags)
{
- struct radeon_device *rdev;
struct radeon_ttm_tt *gtt;
enum ttm_caching caching;
struct radeon_bo *rbo;
-
- rbo = container_of(bo, struct radeon_bo, tbo);
-
- rdev = radeon_get_rdev(bo->bdev);
#if IS_ENABLED(CONFIG_AGP)
+ struct radeon_device *rdev = radeon_get_rdev(bo->bdev);
+
if (rdev->flags & RADEON_IS_AGP) {
return ttm_agp_tt_create(bo, rdev->ddev->agp->bridge,
page_flags);
}
#endif
+ rbo = container_of(bo, struct radeon_bo, tbo);
gtt = kzalloc(sizeof(struct radeon_ttm_tt), GFP_KERNEL);
if (gtt == NULL) {