public inbox for linux-safety@lists.elisa.tech
 help / color / mirror / Atom feed
From: Nghia Le <nghialm78@gmail.com>
To: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Cc: linux-safety@lists.elisa.tech
Subject: Re: [PATCH] io_uring: remove redundant assignment to ret in io_register_iowq_max_workers()
Date: Wed, 3 Nov 2021 02:14:00 +0700	[thread overview]
Message-ID: <20211102191400.GA28342@ubuntu> (raw)
In-Reply-To: <CAKXUXMwKzf8+wjA_kFhBjETPs-6ZBgHmHP_q7pi6er=1RxpQBA@mail.gmail.com>

On Tue, Nov 02, 2021 at 05:30:54PM +0100, Lukas Bulwahn wrote:
> On Fri, Oct 29, 2021 at 6:00 PM Nghia Le <nghialm78@gmail.com> wrote:
> >
> > After the assignment, no paths but only exit path 'err' using ret as
> > return value. However,before going to exit path 'err', ret is changed
> > as the return value of io_wq_max_workers(). Hence, the assignment is
> > redundant and can be removed.
> >
> 
> Just a few comments on wording:
> 
>  After the assignment, no paths but only exit path 'err' using ret as
> return value.
> 
> -> in proper English (as far as I understand):
> 
> Only the exit path with label 'err' uses ret as return value.
> 
I still keep 'After the assignment' to emphasize that we don't involve
the value of ret before the assignment.
> ---
> However, before going to exit path 'err', ret is changed as the return
> value of io_wq_max_workers().
> 
> -> in proper English (as far as I understand):
> 
> However, before exiting through this path with label 'err', ret is
> assigned with the return value of io_wq_max_workers().
> 
> ---
> Hence, the assignment is redundant and can be removed.
> 
> How about?
> 
> Hence, the initial assignment is redundant and can be removed.
> 
> 
> Other than that, it looks good. How about rephrasing a bit as above
> and then sending it to the authors?
> 
> Lukas
> 
> > Signed-off-by: Nghia Le <nghialm78@gmail.com>
> > ---
> >  fs/io_uring.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/fs/io_uring.c b/fs/io_uring.c
> > index acc05ff3aa19..d18f1f46ca83 100644
> > --- a/fs/io_uring.c
> > +++ b/fs/io_uring.c
> > @@ -10800,7 +10800,6 @@ static __cold int io_register_iowq_max_workers(struct io_ring_ctx *ctx,
> >         memcpy(ctx->iowq_limits, new_count, sizeof(new_count));
> >         ctx->iowq_limits_set = true;
> >
> > -       ret = -EINVAL;
> >         if (tctx && tctx->io_wq) {
> >                 ret = io_wq_max_workers(tctx->io_wq, new_count);
> >                 if (ret)
> > --
> > 2.25.1
> >
Thanks Lukas, I submitted patch.


WARNING: multiple messages have this Message-ID (diff)
From: "Nghia Le" <nghialm78@gmail.com>
To: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Cc: linux-safety@lists.elisa.tech
Subject: Re: [linux-safety] [PATCH] io_uring: remove redundant assignment to ret in io_register_iowq_max_workers()
Date: Wed, 3 Nov 2021 02:14:00 +0700	[thread overview]
Message-ID: <20211102191400.GA28342@ubuntu> (raw)
Message-ID: <20211102191400.d5M8RmSYBurqvU8duzurQImyVT4fwIYi5MTgKuDI_X0@z> (raw)
In-Reply-To: <CAKXUXMwKzf8+wjA_kFhBjETPs-6ZBgHmHP_q7pi6er=1RxpQBA@mail.gmail.com>

On Tue, Nov 02, 2021 at 05:30:54PM +0100, Lukas Bulwahn wrote:
> On Fri, Oct 29, 2021 at 6:00 PM Nghia Le <nghialm78@gmail.com> wrote:
> >
> > After the assignment, no paths but only exit path 'err' using ret as
> > return value. However,before going to exit path 'err', ret is changed
> > as the return value of io_wq_max_workers(). Hence, the assignment is
> > redundant and can be removed.
> >
> 
> Just a few comments on wording:
> 
>  After the assignment, no paths but only exit path 'err' using ret as
> return value.
> 
> -> in proper English (as far as I understand):
> 
> Only the exit path with label 'err' uses ret as return value.
> 
I still keep 'After the assignment' to emphasize that we don't involve
the value of ret before the assignment.
> ---
> However, before going to exit path 'err', ret is changed as the return
> value of io_wq_max_workers().
> 
> -> in proper English (as far as I understand):
> 
> However, before exiting through this path with label 'err', ret is
> assigned with the return value of io_wq_max_workers().
> 
> ---
> Hence, the assignment is redundant and can be removed.
> 
> How about?
> 
> Hence, the initial assignment is redundant and can be removed.
> 
> 
> Other than that, it looks good. How about rephrasing a bit as above
> and then sending it to the authors?
> 
> Lukas
> 
> > Signed-off-by: Nghia Le <nghialm78@gmail.com>
> > ---
> >  fs/io_uring.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/fs/io_uring.c b/fs/io_uring.c
> > index acc05ff3aa19..d18f1f46ca83 100644
> > --- a/fs/io_uring.c
> > +++ b/fs/io_uring.c
> > @@ -10800,7 +10800,6 @@ static __cold int io_register_iowq_max_workers(struct io_ring_ctx *ctx,
> >         memcpy(ctx->iowq_limits, new_count, sizeof(new_count));
> >         ctx->iowq_limits_set = true;
> >
> > -       ret = -EINVAL;
> >         if (tctx && tctx->io_wq) {
> >                 ret = io_wq_max_workers(tctx->io_wq, new_count);
> >                 if (ret)
> > --
> > 2.25.1
> >
Thanks Lukas, I submitted patch.


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#260): https://lists.elisa.tech/g/linux-safety/message/260
Mute This Topic: https://lists.elisa.tech/mt/86680054/5278000
Group Owner: linux-safety+owner@lists.elisa.tech
Unsubscribe: https://lists.elisa.tech/g/linux-safety/unsub [linux-safety@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-



  parent reply	other threads:[~2021-11-02 19:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-29 15:59 [PATCH] io_uring: remove redundant assignment to ret in io_register_iowq_max_workers() Nghia Le
2021-10-29 15:59 ` [linux-safety] " Nghia Le
2021-11-02 16:30 ` Lukas Bulwahn
2021-11-02 16:30   ` [linux-safety] " Lukas Bulwahn
2021-11-02 19:14   ` Nghia Le [this message]
2021-11-02 19:14     ` Nghia Le

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 \
    --in-reply-to=20211102191400.GA28342@ubuntu \
    --to=nghialm78@gmail.com \
    --cc=linux-safety@lists.elisa.tech \
    --cc=lukas.bulwahn@gmail.com \
    /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