Skip to contentSkip to conversation

drm/drm_syncobj: Dead code removal

PATCH In review Zbigniew Kempczyński 4 participants 4 messages Oct 4, 2019 – Oct 9, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/drm_syncobj: Dead code removal

Remove dead code, likely overseened during review process.

Cc Chunming Zhou <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jason Ekstrand <[email protected]>
---
 drivers/gpu/drm/drm_syncobj.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/gpu/drm/drm_syncobj.c +0 -4
index 4b5c7b0ed714..21a22e39c9fa 100644
@@ -192,8 +192,6 @@ static void drm_syncobj_fence_add_wait(struct drm_syncobj *syncobj,
 	if (!fence || dma_fence_chain_find_seqno(&fence, wait->point)) {
 		dma_fence_put(fence);
 		list_add_tail(&wait->node, &syncobj->cb_list);
-	} else if (!fence) {
-		wait->fence = dma_fence_get_stub();
 	} else {
 		wait->fence = fence;
 	}
@@ -856,8 +854,6 @@ static void syncobj_wait_syncobj_func(struct drm_syncobj *syncobj,
 	if (!fence || dma_fence_chain_find_seqno(&fence, wait->point)) {
 		dma_fence_put(fence);
 		return;
-	} else if (!fence) {
-		wait->fence = dma_fence_get_stub();
 	} else {
 		wait->fence = fence;
 	}
Signature · 6 lines
2.23.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw
In reply to Zbigniew Kempczyński
Quoted 24 lines · Zbigniew Kempczyński

Remove dead code, likely overseened during review process.

Cc Chunming Zhou <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jason Ekstrand <[email protected]>
---
  drivers/gpu/drm/drm_syncobj.c | 4 ----
  1 file changed, 4 deletions(-)
drivers/gpu/drm/drm_syncobj.c +0 -2
index 4b5c7b0ed714..21a22e39c9fa 100644
@@ -192,8 +192,6 @@ static void drm_syncobj_fence_add_wait(struct drm_syncobj *syncobj,
  	if (!fence || dma_fence_chain_find_seqno(&fence, wait->point)) {
  		dma_fence_put(fence);
  		list_add_tail(&wait->node, &syncobj->cb_list);
-	} else if (!fence) {
-		wait->fence = dma_fence_get_stub();
  	} else {
  		wait->fence = fence;
  	}

drivers/gpu/drm/drm_syncobj.c static void syncobj_wait_syncobj_func(struct drm_syncobj *syncobj, · line 859

Quoted 8 lines
drivers/gpu/drm/drm_syncobj.c +0 -2
@@ -856,8 +854,6 @@ static void syncobj_wait_syncobj_func(struct drm_syncobj *syncobj,
  	if (!fence || dma_fence_chain_find_seqno(&fence, wait->point)) {
  		dma_fence_put(fence);
  		return;
-	} else if (!fence) {
-		wait->fence = dma_fence_get_stub();
  	} else {
  		wait->fence = fence;
  	}

Like Chris said, dma_fence_chain_find_seqno() will update the fence pointer, so a subsequent check might not be dealing with the same value.

A bit cheeky, but...

-Lionel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
Quoted 37 lines · Lionel Landwerlin
Quoted 24 lines · Zbigniew Kempczyński

Remove dead code, likely overseened during review process.

Cc Chunming Zhou <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jason Ekstrand <[email protected]>
---
  drivers/gpu/drm/drm_syncobj.c | 4 ----
  1 file changed, 4 deletions(-)
drivers/gpu/drm/drm_syncobj.c +0 -2
index 4b5c7b0ed714..21a22e39c9fa 100644
@@ -192,8 +192,6 @@ static void drm_syncobj_fence_add_wait(struct drm_syncobj *syncobj,
  	if (!fence || dma_fence_chain_find_seqno(&fence, wait->point)) {
  		dma_fence_put(fence);
  		list_add_tail(&wait->node, &syncobj->cb_list);
-	} else if (!fence) {
-		wait->fence = dma_fence_get_stub();
  	} else {
  		wait->fence = fence;
  	}

drivers/gpu/drm/drm_syncobj.c static void syncobj_wait_syncobj_func(struct drm_syncobj *syncobj, · line 859

Quoted 8 lines
drivers/gpu/drm/drm_syncobj.c +0 -2
@@ -856,8 +854,6 @@ static void syncobj_wait_syncobj_func(struct drm_syncobj *syncobj,
  	if (!fence || dma_fence_chain_find_seqno(&fence, wait->point)) {
  		dma_fence_put(fence);
  		return;
-	} else if (!fence) {
-		wait->fence = dma_fence_get_stub();
  	} else {
  		wait->fence = fence;
  	}

Like Chris said, dma_fence_chain_find_seqno() will update the fence pointer, so a subsequent check might not be dealing with the same value.

Quoted 1 line

A bit cheeky, but...

Feels like warrants a comment, I missed this one too. Maybe even extract it into one common function since it's the same code in both places? -Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel