From: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx> IORING_{UN,}REGISTER_EVENTFD and IORING_REGISTER_EVENTFD_ASYNC don't return a positive value. These branches are useless. Remove them. [1]: io_eventfd_register [2]: io_eventfd_unregister Kernel-code-ref: https://github.com/torvalds/linux/blob/v6.1-rc6/io_uring/io_uring.c#L2511-L2547 [1] Kernel-code-ref: https://github.com/torvalds/linux/blob/v6.1-rc6/io_uring/io_uring.c#L2549-L2564 [2] Signed-off-by: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx> --- src/register.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/register.c b/src/register.c index e849825..6cd607e 100644 --- a/src/register.c +++ b/src/register.c @@ -208,30 +208,21 @@ int io_uring_unregister_files(struct io_uring *ring) int io_uring_register_eventfd(struct io_uring *ring, int event_fd) { - int ret; - - ret = __sys_io_uring_register(ring->ring_fd, IORING_REGISTER_EVENTFD, - &event_fd, 1); - return (ret < 0) ? ret : 0; + return __sys_io_uring_register(ring->ring_fd, IORING_REGISTER_EVENTFD, + &event_fd, 1); } int io_uring_unregister_eventfd(struct io_uring *ring) { - int ret; - - ret = __sys_io_uring_register(ring->ring_fd, IORING_UNREGISTER_EVENTFD, - NULL, 0); - return (ret < 0) ? ret : 0; + return __sys_io_uring_register(ring->ring_fd, IORING_UNREGISTER_EVENTFD, + NULL, 0); } int io_uring_register_eventfd_async(struct io_uring *ring, int event_fd) { - int ret; - - ret = __sys_io_uring_register(ring->ring_fd, - IORING_REGISTER_EVENTFD_ASYNC, &event_fd, - 1); - return (ret < 0) ? ret : 0; + return __sys_io_uring_register(ring->ring_fd, + IORING_REGISTER_EVENTFD_ASYNC, &event_fd, + 1); } int io_uring_register_probe(struct io_uring *ring, struct io_uring_probe *p, -- Ammar Faizi