[PATCH liburing v1 2/5] register: Remove useless branches in {un,}register buffers

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

 



From: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx>

IORING_REGISTER_BUFFERS and IORING_UNREGISTER_BUFFERS don't return a
positive value. These bracnes are useless. Remove them.

[1]: io_sqe_buffers_register
[2]: io_sqe_buffers_unregister

Kernel-code-ref: https://github.com/torvalds/linux/blob/v6.1-rc6/io_uring/rsrc.c#L1250-L1307 [1]
Kernel-code-ref: https://github.com/torvalds/linux/blob/v6.1-rc6/io_uring/rsrc.c#L1036-L1054 [2]
Signed-off-by: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx>
---
 src/register.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/register.c b/src/register.c
index 6cd607e..adb64cc 100644
--- a/src/register.c
+++ b/src/register.c
@@ -54,20 +54,14 @@ int io_uring_register_buffers_sparse(struct io_uring *ring, unsigned nr)
 int io_uring_register_buffers(struct io_uring *ring, const struct iovec *iovecs,
 			      unsigned nr_iovecs)
 {
-	int ret;
-
-	ret = __sys_io_uring_register(ring->ring_fd, IORING_REGISTER_BUFFERS,
-				      iovecs, nr_iovecs);
-	return (ret < 0) ? ret : 0;
+	return __sys_io_uring_register(ring->ring_fd, IORING_REGISTER_BUFFERS,
+				       iovecs, nr_iovecs);
 }
 
 int io_uring_unregister_buffers(struct io_uring *ring)
 {
-	int ret;
-
-	ret = __sys_io_uring_register(ring->ring_fd, IORING_UNREGISTER_BUFFERS,
-				      NULL, 0);
-	return (ret < 0) ? ret : 0;
+	return __sys_io_uring_register(ring->ring_fd, IORING_UNREGISTER_BUFFERS,
+				       NULL, 0);
 }
 
 int io_uring_register_files_update_tag(struct io_uring *ring, unsigned off,
-- 
Ammar Faizi




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux