Skip to contentSkip to conversation

vmwgfx: remove identical branches

PATCH Dave Jones 2 participants 2 messages Jul 22, 2014

Subsystems (3)
lore
Share & tools
lore

Dave Jones

author
#0 lore raw

Commit 8b7de6aa8468: "vmwgfx: Rework fence event action" removed the tv_sec & tv_usec arguments to vmw_event_fence_action_create, which meant that both sides of the if/else are now exactly the same.

Remove the flag check, and just do it unconditionally.

Spotted with Coverity.

drivers/gpu/drm/vmwgfx/vmwgfx_fence.c +4 -10
index 436b013b4231..a078e6bbaf0a 100644
@@ -1124,16 +1124,10 @@ int vmw_fence_event_ioctl(struct drm_device *dev, void *data,
 
 	BUG_ON(fence == NULL);
 
-	if (arg->flags & DRM_VMW_FE_FLAG_REQ_TIME)
-		ret = vmw_event_fence_action_create(file_priv, fence,
-						    arg->flags,
-						    arg->user_data,
-						    true);
-	else
-		ret = vmw_event_fence_action_create(file_priv, fence,
-						    arg->flags,
-						    arg->user_data,
-						    true);
+	ret = vmw_event_fence_action_create(file_priv, fence,
+					    arg->flags,
+					    arg->user_data,
+					    true);
 
 	if (unlikely(ret != 0)) {
 		if (ret != -ERESTARTSYS)
Reviewed-by
#1 lore raw

----- Original Message -----

Quoted 9 lines

Commit 8b7de6aa8468: "vmwgfx: Rework fence event action" removed the tv_sec & tv_usec arguments to vmw_event_fence_action_create, which meant that both sides of the if/else are now exactly the same.

Remove the flag check, and just do it unconditionally.

Spotted with Coverity.

and thanks for the patch.

Cheers, Jakob.

Quoted 29 lines
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c +4 -10
index 436b013b4231..a078e6bbaf0a 100644
@@ -1124,16 +1124,10 @@ int vmw_fence_event_ioctl(struct drm_device *dev,
 void *data,
 
 	BUG_ON(fence == NULL);
 
-	if (arg->flags & DRM_VMW_FE_FLAG_REQ_TIME)
-		ret = vmw_event_fence_action_create(file_priv, fence,
-						    arg->flags,
-						    arg->user_data,
-						    true);
-	else
-		ret = vmw_event_fence_action_create(file_priv, fence,
-						    arg->flags,
-						    arg->user_data,
-						    true);
+	ret = vmw_event_fence_action_create(file_priv, fence,
+					    arg->flags,
+					    arg->user_data,
+					    true);
 
 	if (unlikely(ret != 0)) {

if (ret != -ERESTARTSYS)