Skip to contentSkip to conversation

drm/virtio: Remove redundant return type

PATCH In review Robert Foss 3 participants 5 messages May 3, 2019 – May 6, 2019

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

PATCH 1/1 drm/virtio: Remove redundant return type

virtio_gpu_fence_emit() always returns 0, since it has no error paths.

Consequently no calls for virtio_gpu_fence_emit() use the return value, and it can be removed.

---

This patch was suggested in this email thread:

[PATCH] drm/virtio: allocate fences with GFP_KERNEL
https://www.spinics.net/lists/dri-devel/msg208536.html

 drivers/gpu/drm/virtio/virtgpu_drv.h   | 2 +-
 drivers/gpu/drm/virtio/virtgpu_fence.c | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/virtio/virtgpu_drv.h +1 -1
index d577cb76f5ad..9bc56887fbdb 100644
@@ -334,7 +334,7 @@ int virtio_gpu_mmap(struct file *filp, struct vm_area_struct *vma);
 /* virtio_gpu_fence.c */
 struct virtio_gpu_fence *virtio_gpu_fence_alloc(
 	struct virtio_gpu_device *vgdev);
-int virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
+void virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
 			  struct virtio_gpu_ctrl_hdr *cmd_hdr,
 			  struct virtio_gpu_fence *fence);
 void virtio_gpu_fence_event_process(struct virtio_gpu_device *vdev,
drivers/gpu/drm/virtio/virtgpu_fence.c +1 -2
index 21bd4c4a32d1..e0744ac768cc 100644
@@ -81,7 +81,7 @@ struct virtio_gpu_fence *virtio_gpu_fence_alloc(struct virtio_gpu_device *vgdev)
 	return fence;
 }
 
-int virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
+void virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
 			  struct virtio_gpu_ctrl_hdr *cmd_hdr,
 			  struct virtio_gpu_fence *fence)
 {
@@ -96,7 +96,6 @@ int virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
 
 	cmd_hdr->flags |= cpu_to_le32(VIRTIO_GPU_FLAG_FENCE);
 	cmd_hdr->fence_id = cpu_to_le64(fence->seq);
-	return 0;
 }
 
 void virtio_gpu_fence_event_process(struct virtio_gpu_device *vgdev,
Signature · 1 line
2.20.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Robert Foss

virtio_gpu_fence_emit() always returns 0, since it has no error paths.

Consequently no calls for virtio_gpu_fence_emit() use the return value, and it can be removed.

Quoted 48 lines

---

This patch was suggested in this email thread:

[PATCH] drm/virtio: allocate fences with GFP_KERNEL
https://www.spinics.net/lists/dri-devel/msg208536.html

 drivers/gpu/drm/virtio/virtgpu_drv.h   | 2 +-
 drivers/gpu/drm/virtio/virtgpu_fence.c | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/virtio/virtgpu_drv.h +1 -1
index d577cb76f5ad..9bc56887fbdb 100644
@@ -334,7 +334,7 @@ int virtio_gpu_mmap(struct file *filp, struct vm_area_struct *vma);
 /* virtio_gpu_fence.c */
 struct virtio_gpu_fence *virtio_gpu_fence_alloc(
        struct virtio_gpu_device *vgdev);
-int virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
+void virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
                          struct virtio_gpu_ctrl_hdr *cmd_hdr,
                          struct virtio_gpu_fence *fence);
 void virtio_gpu_fence_event_process(struct virtio_gpu_device *vdev,
drivers/gpu/drm/virtio/virtgpu_fence.c +1 -3
index 21bd4c4a32d1..e0744ac768cc 100644
@@ -81,7 +81,7 @@ struct virtio_gpu_fence *virtio_gpu_fence_alloc(struct virtio_gpu_device *vgdev)
        return fence;
 }
 
-int virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
+void virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
                          struct virtio_gpu_ctrl_hdr *cmd_hdr,
                          struct virtio_gpu_fence *fence)
 {
@@ -96,7 +96,6 @@ int virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
 
        cmd_hdr->flags |= cpu_to_le32(VIRTIO_GPU_FLAG_FENCE);
        cmd_hdr->fence_id = cpu_to_le64(fence->seq);
-       return 0;
 }
 
 void virtio_gpu_fence_event_process(struct virtio_gpu_device *vgdev,
--

2.20.1

reviewer Reviewed-by on v1 1/1
#2 lore raw
In reply to Robert Foss
Quoted 9 lines · Robert Foss

virtio_gpu_fence_emit() always returns 0, since it has no error paths.

Consequently no calls for virtio_gpu_fence_emit() use the return value, and it can be removed.

Quoted 46 lines

---

This patch was suggested in this email thread:

[PATCH] drm/virtio: allocate fences with GFP_KERNEL
https://www.spinics.net/lists/dri-devel/msg208536.html

 drivers/gpu/drm/virtio/virtgpu_drv.h   | 2 +-
 drivers/gpu/drm/virtio/virtgpu_fence.c | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/virtio/virtgpu_drv.h +1 -1
index d577cb76f5ad..9bc56887fbdb 100644
@@ -334,7 +334,7 @@ int virtio_gpu_mmap(struct file *filp, struct vm_area_struct *vma);
 /* virtio_gpu_fence.c */
 struct virtio_gpu_fence *virtio_gpu_fence_alloc(
        struct virtio_gpu_device *vgdev);
-int virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
+void virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
                          struct virtio_gpu_ctrl_hdr *cmd_hdr,
                          struct virtio_gpu_fence *fence);
 void virtio_gpu_fence_event_process(struct virtio_gpu_device *vdev,
drivers/gpu/drm/virtio/virtgpu_fence.c +1 -3
index 21bd4c4a32d1..e0744ac768cc 100644
@@ -81,7 +81,7 @@ struct virtio_gpu_fence *virtio_gpu_fence_alloc(struct virtio_gpu_device *vgdev)
        return fence;
 }
 
-int virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
+void virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
                          struct virtio_gpu_ctrl_hdr *cmd_hdr,
                          struct virtio_gpu_fence *fence)
 {
@@ -96,7 +96,6 @@ int virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
 
        cmd_hdr->flags |= cpu_to_le32(VIRTIO_GPU_FLAG_FENCE);
        cmd_hdr->fence_id = cpu_to_le64(fence->seq);
-       return 0;
 }
 
 void virtio_gpu_fence_event_process(struct virtio_gpu_device *vgdev,
--
Quoted 2 lines

2.20.1

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

maintainer
#3 lore raw
In reply to Robert Foss
Quoted 8 lines · Robert Foss

virtio_gpu_fence_emit() always returns 0, since it has no error paths.

Consequently no calls for virtio_gpu_fence_emit() use the return value, and it can be removed.

Doesn't apply cleanly to drm-misc-next, probably conflicts with one of the other virtio fence patches just pushed. Can you rebase and resend?

thanks,
Gerd

maintainer
#4 lore raw
In reply to Robert Foss
Quoted 8 lines · Robert Foss

virtio_gpu_fence_emit() always returns 0, since it has no error paths.

Consequently no calls for virtio_gpu_fence_emit() use the return value, and it can be removed.

Doesn't apply cleanly to drm-misc-next, probably conflicts with one of the other virtio fence patches just pushed. Can you rebase and resend?

thanks,
Gerd