[PATCH 2/5] drm/vgem: Remove assignment in if condition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch fixes the checkpatch.pl error:

vgem_fence.c:196: ERROR: do not use assignment in if condition

Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@xxxxxxxxx>
---
 drivers/gpu/drm/vgem/vgem_fence.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/vgem/vgem_fence.c b/drivers/gpu/drm/vgem/vgem_fence.c
index b28876c222b4..f5b659463b00 100644
--- a/drivers/gpu/drm/vgem/vgem_fence.c
+++ b/drivers/gpu/drm/vgem/vgem_fence.c
@@ -191,10 +191,13 @@ int vgem_fence_attach_ioctl(struct drm_device *dev,
 	/* Expose the fence via the dma-buf */
 	ret = 0;
 	reservation_object_lock(resv, NULL);
-	if (arg->flags & VGEM_FENCE_WRITE)
+	if (arg->flags & VGEM_FENCE_WRITE) {
 		reservation_object_add_excl_fence(resv, fence);
-	else if ((ret = reservation_object_reserve_shared(resv)) == 0)
-		reservation_object_add_shared_fence(resv, fence);
+	} else {
+		ret = reservation_object_reserve_shared(resv);
+		if (!ret)
+			reservation_object_add_shared_fence(resv, fence);
+	}
 	reservation_object_unlock(resv);
 
 	/* Record the fence in our idr for later signaling */
-- 
2.16.2

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux