Skip to contentSkip to conversation

drm/ttm: Remove redundant code in ttm_tt_init_fields

PATCH Superseded Ma Jun 3 participants 3 messages May 29, 2023 – May 31, 2023

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Ma Jun

author
#0 lore raw

PATCH 1/1 drm/ttm: Remove redundant code in ttm_tt_init_fields

Remove redundant assignment code for ttm->caching

---
 drivers/gpu/drm/ttm/ttm_tt.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/ttm/ttm_tt.c +0 -1
index 02b812dacc5d..45a44544b656 100644
@@ -143,7 +143,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.34.1
#1 lore raw

Am 29.05.23 um 11:28 schrieb Ma Jun:

Quoted 1 line

Remove redundant assignment code for ttm->caching

The explanation is missing why this is redundant, e.g. something like "this is overwritten just a few lines later"..

Apart from that looks good to me,
Christian.,

Quoted 18 lines
---
  drivers/gpu/drm/ttm/ttm_tt.c | 1 -
  1 file changed, 1 deletion(-)
drivers/gpu/drm/ttm/ttm_tt.c +0 -1
index 02b812dacc5d..45a44544b656 100644
@@ -143,7 +143,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;
#2 lore raw
Quoted 6 lines · Christian König

Am 29.05.23 um 11:28 schrieb Ma Jun:

Quoted 1 line

Remove redundant assignment code for ttm->caching

The explanation is missing why this is redundant, e.g. something like "this is overwritten just a few lines later"..

Thanks for review. Will update the commit message in v2

Regards,
Ma Jun

Quoted 22 lines

Apart from that looks good to me,
Christian.,

Quoted 18 lines
---
  drivers/gpu/drm/ttm/ttm_tt.c | 1 -
  1 file changed, 1 deletion(-)
drivers/gpu/drm/ttm/ttm_tt.c +0 -1
index 02b812dacc5d..45a44544b656 100644
@@ -143,7 +143,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;