diff mbox series

[liburing,v1,5/5] register: Remove useless branch in register restrictions

Message ID 20221123124922.3612798-6-ammar.faizi@intel.com (mailing list archive)
State New
Headers show
Series Remove useless brances in register functions | expand

Commit Message

Ammar Faizi Nov. 23, 2022, 12:53 p.m. UTC
From: Ammar Faizi <ammarfaizi2@gnuweeb.org>

IORING_REGISTER_RESTRICTIONS doesn't return a positive value. This
branch is useless. Remove it.

[1]: io_register_restrictions

Kernel-code-ref: https://github.com/torvalds/linux/blob/v6.1-rc6/io_uring/io_uring.c#L3665-L3733 [1]
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
---
 src/register.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/src/register.c b/src/register.c
index 6075f04..5fdc6e5 100644
--- a/src/register.c
+++ b/src/register.c
@@ -239,12 +239,9 @@  int io_uring_register_restrictions(struct io_uring *ring,
 				   struct io_uring_restriction *res,
 				   unsigned int nr_res)
 {
-	int ret;
-
-	ret = __sys_io_uring_register(ring->ring_fd,
-				      IORING_REGISTER_RESTRICTIONS, res,
-				      nr_res);
-	return (ret < 0) ? ret : 0;
+	return __sys_io_uring_register(ring->ring_fd,
+				       IORING_REGISTER_RESTRICTIONS, res,
+				       nr_res);
 }
 
 int io_uring_enable_rings(struct io_uring *ring)