Skip to contentSkip to conversation

drm/ttm: Remove duplicate assignments to ttm->caching

PATCH In review Feng Jiang 2 participants 3 messages Jun 25, 2023 – Jun 30, 2023 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

Feng Jiang

author
#0 lore raw

PATCH 1/1 drm/ttm: Remove duplicate assignments to ttm->caching

The parameter 'caching' has already been assigned to 'ttm->caching', so 'ttm_cached' is redundant.

Fixes 1b4ea4c5980f ("drm/ttm: set the tt caching state at creation time")
---
 drivers/gpu/drm/ttm/ttm_tt.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/ttm/ttm_tt.c +0 -1
index ab725d9d14a6..1ce4b36ab33b 100644
@@ -137,7 +137,6 @@ static void ttm_tt_init_fields(struct ttm_tt *ttm,
 			       unsigned long extra_pages)
 {
 	ttm->num_pages = (PAGE_ALIGN(bo->base.size) >> PAGE_SHIFT) + extra_pages;
-	ttm->caching = ttm_cached;
 	ttm->page_flags = page_flags;
 	ttm->dma_address = NULL;
 	ttm->swap_storage = NULL;
Signature · 1 line
2.41.0
Reviewed-by Guchun Chen Reviewed-by on v1 1/1
#1 lore raw

This has already been fixed with:

commit 2ce977df10c179138e2723b25c2d2c055a3e3cc6
Author: Ma Jun <[email protected]>
Date:   Wed May 31 13:30:51 2023 +0800

    drm/ttm: Remove redundant code in ttm_tt_init_fields

    Remove redundant assignment code for ttm->caching as it's overwritten just a few lines later.

    v2:
     - Update the commit message.

Regards,
Christian.

Am 25.06.23 um 04:45 schrieb Feng Jiang:

Quoted 21 lines

The parameter 'caching' has already been assigned to 'ttm->caching', so 'ttm_cached' is redundant.

Fixes 1b4ea4c5980f ("drm/ttm: set the tt caching state at creation time")
---
  drivers/gpu/drm/ttm/ttm_tt.c | 1 -
  1 file changed, 1 deletion(-)
drivers/gpu/drm/ttm/ttm_tt.c +0 -1
index ab725d9d14a6..1ce4b36ab33b 100644
@@ -137,7 +137,6 @@ static void ttm_tt_init_fields(struct ttm_tt *ttm,
  			       unsigned long extra_pages)
  {
  	ttm->num_pages = (PAGE_ALIGN(bo->base.size) >> PAGE_SHIFT) + extra_pages;
-	ttm->caching = ttm_cached;
  	ttm->page_flags = page_flags;
  	ttm->dma_address = NULL;
  	ttm->swap_storage = NULL;

A message that is not in the archive (sent off-list or not yet received): 1688091259850883.47.seg@mailgw

author
#3 lore raw
Quoted 34 lines · Christian König

This has already been fixed with:

commit 2ce977df10c179138e2723b25c2d2c055a3e3cc6
Author: Ma Jun <[email protected]>
Date:   Wed May 31 13:30:51 2023 +0800

    drm/ttm: Remove redundant code in ttm_tt_init_fields

    Remove redundant assignment code for ttm->caching as it's overwritten just a few lines later.

    v2:
     - Update the commit message.

Regards,
Christian.

Am 25.06.23 um 04:45 schrieb Feng Jiang:

Quoted 9 lines

The parameter 'caching' has already been assigned to 'ttm->caching', so 'ttm_cached' is redundant.

Fixes 1b4ea4c5980f ("drm/ttm: set the tt caching state at creation time")

---
  drivers/gpu/drm/ttm/ttm_tt.c | 1 -

  1 file changed, 1 deletion(-)
Quoted 13 lines

drivers/gpu/drm/ttm/ttm_tt.c static void ttm_tt_init_fields(struct ttm_tt *ttm, · line 142

Quoted 12 lines
drivers/gpu/drm/ttm/ttm_tt.c +0 -1
index ab725d9d14a6..1ce4b36ab33b 100644
@@ -137,7 +137,6 @@ static void ttm_tt_init_fields(struct ttm_tt *ttm,
                      unsigned long extra_pages)
   {
       ttm->num_pages = (PAGE_ALIGN(bo->base.size) >> PAGE_SHIFT) + extra_pages;
-    ttm->caching = ttm_cached;
       ttm->page_flags = page_flags;
       ttm->dma_address = NULL;
       ttm->swap_storage = NULL;

Sorry, I will check before sending next time, thanks!

Signature · 2 lines
Best regards,
Feng