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

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

 



From: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx>

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@xxxxxxxxxxx>
---
 src/register.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

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)
-- 
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