linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm: amd: amdgpu: constify ttm_place structures.
@ 2017-07-02  9:13 Arvind Yadav
  2017-07-02 12:44 ` Christian König
  2017-07-03  7:18 ` Christian König
  0 siblings, 2 replies; 3+ messages in thread
From: Arvind Yadav @ 2017-07-02  9:13 UTC (permalink / raw)
  To: alexander.deucher, christian.koenig, airlied
  Cc: amd-gfx, dri-devel, linux-kernel

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.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 5db0230..a2c8380 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -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
-- 
2.7.4

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

* Re: [PATCH] drm: amd: amdgpu: constify ttm_place structures.
  2017-07-02  9:13 [PATCH] drm: amd: amdgpu: constify ttm_place structures Arvind Yadav
@ 2017-07-02 12:44 ` Christian König
  2017-07-03  7:18 ` Christian König
  1 sibling, 0 replies; 3+ messages in thread
From: Christian König @ 2017-07-02 12:44 UTC (permalink / raw)
  To: Arvind Yadav, alexander.deucher, christian.koenig, airlied
  Cc: dri-devel, amd-gfx, linux-kernel

Am 02.07.2017 um 11:13 schrieb Arvind Yadav:
> 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.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>

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

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 5db0230..a2c8380 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -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

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

* Re: [PATCH] drm: amd: amdgpu: constify ttm_place structures.
  2017-07-02  9:13 [PATCH] drm: amd: amdgpu: constify ttm_place structures Arvind Yadav
  2017-07-02 12:44 ` Christian König
@ 2017-07-03  7:18 ` Christian König
  1 sibling, 0 replies; 3+ messages in thread
From: Christian König @ 2017-07-03  7:18 UTC (permalink / raw)
  To: Arvind Yadav, alexander.deucher, christian.koenig, airlied
  Cc: dri-devel, amd-gfx, linux-kernel

Am 02.07.2017 um 11:13 schrieb Arvind Yadav:
> 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.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>

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

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 5db0230..a2c8380 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -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

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

end of thread, other threads:[~2017-07-03  7:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-02  9:13 [PATCH] drm: amd: amdgpu: constify ttm_place structures Arvind Yadav
2017-07-02 12:44 ` Christian König
2017-07-03  7:18 ` Christian König

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