From: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: outreachy-kernel@googlegroups.com,
David Kershner <david.kershner@unisys.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
sparmaintainer@unisys.com, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org, Daniel Vetter <daniel@ffwll.ch>,
Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH v7] staging: unisys: visorhba: Convert module from IDR to XArray
Date: Tue, 04 May 2021 15:58:02 +0200 [thread overview]
Message-ID: <3550993.e1xmc6yJDa@linux.local> (raw)
In-Reply-To: <20210504134216.GG1847222@casper.infradead.org>
On Tuesday, May 4, 2021 3:42:16 PM CEST Matthew Wilcox wrote:
> On Tue, May 04, 2021 at 03:32:53PM +0200, Fabio M. De Francesco wrote:
> > Changes from v6; Added a call to xa_destroy() that I had forgotten.
>
> What? No! Go back and re-read what I wrote about this previously.
>
I remember that explanation you gave me some days ago for not using it. But I
was mislead by a comment ("Do we not have to call xa_destroy()?") by Dan and
your "Correct" soon after the above comment. So I thought that I had
misunderstand and the put back that call to xa_destroy(). I lost something in
following the flow of the reviews, I suppose.
>
> > +static int setup_scsitaskmgmt_handles(struct xarray *xa, struct uiscmdrsp
*cmdrsp,
> >
> > wait_queue_head_t *event,
int *result)
> >
> > {
> >
> > - /* specify the event that has to be triggered when this */
> > - /* cmd is complete */
> > - cmdrsp->scsitaskmgmt.notify_handle =
> > - simple_idr_get(idrtable, event, lock);
> > - cmdrsp->scsitaskmgmt.notifyresult_handle =
> > - simple_idr_get(idrtable, result, lock);
> > + int ret;
> > + u32 id;
> > +
> > + /* specify the event that has to be triggered when this cmd is
complete */
> > + ret = xa_alloc_irq(xa, &id, event, xa_limit_32b, GFP_KERNEL);
> > + if (ret)
> > + return ret;
> > + else
> > + cmdrsp->scsitaskmgmt.notify_handle = id;
>
> This 'else' is actively confusing.
>
Unnecessary and redundant, yes.
>
> > + ret = xa_alloc_irq(xa, &id, result, xa_limit_32b, GFP_KERNEL);
> > + if (ret) {
> > + xa_erase_irq(xa, cmdrsp->scsitaskmgmt.notify_handle);
> > + return ret;
> > + } else
> > + cmdrsp->scsitaskmgmt.notifyresult_handle = id;
>
> Ditto.
>
Redundant, again.
Thanks,
Fabio
next prev parent reply other threads:[~2021-05-04 13:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-04 13:32 [PATCH v7] staging: unisys: visorhba: Convert module from IDR to XArray Fabio M. De Francesco
2021-05-04 13:42 ` Matthew Wilcox
2021-05-04 13:58 ` Fabio M. De Francesco [this message]
2021-05-04 14:01 ` [Outreachy kernel] " Matthew Wilcox
2021-05-04 14:38 ` Fabio M. De Francesco
2021-05-04 15:46 ` Greg Kroah-Hartman
2021-05-04 13:46 ` Dan Carpenter
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=3550993.e1xmc6yJDa@linux.local \
--to=fmdefrancesco@gmail.com \
--cc=dan.carpenter@oracle.com \
--cc=daniel@ffwll.ch \
--cc=david.kershner@unisys.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=outreachy-kernel@googlegroups.com \
--cc=sparmaintainer@unisys.com \
--cc=willy@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