From: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx> IORING_UNREGISTER_FILES doesn't return a positive value. This branch is useless. Remove it. [1]: io_sqe_files_unregister Kernel-code-ref: https://github.com/torvalds/linux/blob/v6.1-rc6/io_uring/rsrc.c#L787-L805 [1] Signed-off-by: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx> --- src/register.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/register.c b/src/register.c index adb64cc..c66f63e 100644 --- a/src/register.c +++ b/src/register.c @@ -193,11 +193,8 @@ int io_uring_register_files(struct io_uring *ring, const int *files, int io_uring_unregister_files(struct io_uring *ring) { - int ret; - - ret = __sys_io_uring_register(ring->ring_fd, IORING_UNREGISTER_FILES, - NULL, 0); - return (ret < 0) ? ret : 0; + return __sys_io_uring_register(ring->ring_fd, IORING_UNREGISTER_FILES, + NULL, 0); } int io_uring_register_eventfd(struct io_uring *ring, int event_fd) -- Ammar Faizi