drm: amd: amdgpu: constify ttm_place structures.
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Sun, 2 Jul 2017 09:13:58 +0000 (14:43 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 14 Jul 2017 15:06:03 +0000 (11:06 -0400)
ttm_place are not supposed to change at runtime. All functions
working with ttm_place provided by <drm/ttm/ttm_placement.h> work
with const ttm_place. So mark the non-const structs as const.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

index 7064d31..ace178b 100644 (file)
@@ -186,7 +186,7 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo,
 {
        struct amdgpu_device *adev = amdgpu_ttm_adev(bo->bdev);
        struct amdgpu_bo *abo;
-       static struct ttm_place placements = {
+       static const struct ttm_place placements = {
                .fpfn = 0,
                .lpfn = 0,
                .flags = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM