linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: JaeJoon Jung <rgbi3307@gmail.com>
To: "Liam R. Howlett" <Liam.Howlett@oracle.com>,
	JaeJoon Jung <rgbi3307@gmail.com>,
	 maple-tree@lists.infradead.org,
	"<linux-mm@kvack.org>" <linux-mm@kvack.org>,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH] maple_tree: modified return type of mas_wr_store_entry()
Date: Tue, 28 May 2024 08:20:27 +0900	[thread overview]
Message-ID: <CAHOvCC67kLqZ9Z+ecKNyhz0gSk50N1rn5=twN=Z0p=_0qmGAbA@mail.gmail.com> (raw)
In-Reply-To: <ojvx3usqalady6zp5cwbqjrvtrhjgym4ai7hagbpjvfkfztsu3@2o6nq3hgiblu>

Thank you so much for clarifying and correcting my comments and
sharing it with relevant groups.

On Tue, 28 May 2024 at 00:08, Liam R. Howlett <Liam.Howlett@oracle.com> wrote:
>
> * JaeJoon Jung <rgbi3307@gmail.com> [240524 21:02]:
> > From: Jung-JaeJoon <rgbi3307@gmail.com>
> >
>
> Thank you for your cleanup patch.
>
> I have added two more mailing lists to the Cc.  Please Cc them on any
> other patches related to the maple tree and mm area.
>
> > Since there is no place to use the return value of the mas_wr_store_entry() function,
> > it is correct to modify it to void.
>
> This comment isn't clear.
>
> Maybe something like (please, modify it to your liking):
> "Since the return value of mas_wr_store_entry() is not used, the return
> type can be changed to void"
>
> >
> > Signed-off-by: JaeJoon Jung <rgbi3307@gmail.com>
> > ---
> >  lib/maple_tree.c | 15 ++++++---------
> >  1 file changed, 6 insertions(+), 9 deletions(-)
> >
> > diff --git a/lib/maple_tree.c b/lib/maple_tree.c
> > index 2d7d27e6ae3c..da30977aab0f 100644
> > --- a/lib/maple_tree.c
> > +++ b/lib/maple_tree.c
> > @@ -4203,31 +4203,28 @@ static inline void mas_wr_modify(struct ma_wr_state *wr_mas)
> >   *
> >   * Return: The contents that was stored at the index.
> >   */
> > -static inline void *mas_wr_store_entry(struct ma_wr_state *wr_mas)
> > +static inline void mas_wr_store_entry(struct ma_wr_state *wr_mas)
> >  {
> >       struct ma_state *mas = wr_mas->mas;
> >
> >       wr_mas->content = mas_start(mas);
> >       if (mas_is_none(mas) || mas_is_ptr(mas)) {
> >               mas_store_root(mas, wr_mas->entry);
> > -             return wr_mas->content;
> > +             return;
> >       }
> >
> >       if (unlikely(!mas_wr_walk(wr_mas))) {
> >               mas_wr_spanning_store(wr_mas);
> > -             return wr_mas->content;
> > +             return;
> >       }
> >
> >       /* At this point, we are at the leaf node that needs to be altered. */
> >       mas_wr_end_piv(wr_mas);
> >       /* New root for a single pointer */
> > -     if (unlikely(!mas->index && mas->last == ULONG_MAX)) {
> > +     if (unlikely(!mas->index && mas->last == ULONG_MAX))
> >               mas_new_root(mas, wr_mas->entry);
> > -             return wr_mas->content;
>
> Please keep this return statement, as you did above, for consistency and
> code clarity.
>
> > -     }
> > -
> > -     mas_wr_modify(wr_mas);
> > -     return wr_mas->content;
> > +        else
> > +             mas_wr_modify(wr_mas);
> >  }
> >
> >  /**
> > --
> > 2.17.1
> >


      reply	other threads:[~2024-05-27 23:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240525010223.1704-1-rgbi3307@naver.com>
2024-05-27 15:08 ` Liam R. Howlett
2024-05-27 23:20   ` JaeJoon Jung [this message]

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='CAHOvCC67kLqZ9Z+ecKNyhz0gSk50N1rn5=twN=Z0p=_0qmGAbA@mail.gmail.com' \
    --to=rgbi3307@gmail.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=maple-tree@lists.infradead.org \
    /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