From: Ammar Faizi <[email protected]>
To: Jens Axboe <[email protected]>
Cc: Pavel Begunkov <[email protected]>,
io-uring Mailing List <[email protected]>,
GNU/Weeb Mailing List <[email protected]>,
Muhammad Rizki <[email protected]>,
Alviro Iskandar Setiawan <[email protected]>,
Gilang Fachrezy <[email protected]>,
[email protected], Ammar Faizi <[email protected]>
Subject: [PATCH liburing v1 5/5] register: Remove useless branch in register restrictions
Date: Wed, 23 Nov 2022 19:53:17 +0700 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
From: Ammar Faizi <[email protected]>
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 <[email protected]>
---
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
next prev parent reply other threads:[~2022-11-23 13:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-23 12:53 [PATCH liburing v1 0/5] Remove useless brances in register functions Ammar Faizi
2022-11-23 12:53 ` [PATCH liburing v1 1/5] register: Remove useless branches in {un,}register eventfd Ammar Faizi
2022-11-23 12:53 ` [PATCH liburing v1 2/5] register: Remove useless branches in {un,}register buffers Ammar Faizi
2022-11-23 12:53 ` [PATCH liburing v1 3/5] register: Remove useless branch in unregister files Ammar Faizi
2022-11-23 12:53 ` [PATCH liburing v1 4/5] register: Remove useless branch in register probe Ammar Faizi
2022-11-23 12:53 ` Ammar Faizi [this message]
2022-11-24 13:34 ` [PATCH liburing v1 0/5] Remove useless brances in register functions Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox