From: Markus Armbruster <armbru@redhat.com>
To: Klaus Jensen <its@irrelevant.dk>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
Keith Busch <kbusch@kernel.org>,
Klaus Jensen <k.jensen@samsung.com>
Subject: Re: [PATCH 1/2] hw/nvme: fix incorrect use of errp/local_err
Date: Wed, 09 Nov 2022 14:01:48 +0100 [thread overview]
Message-ID: <871qqcnuwz.fsf@pond.sub.org> (raw)
In-Reply-To: <Y2ugFFtUF7EVHXaG@cormorant.local> (Klaus Jensen's message of "Wed, 9 Nov 2022 13:41:56 +0100")
Klaus Jensen <its@irrelevant.dk> writes:
> On Nov 9 13:36, Markus Armbruster wrote:
>> Klaus Jensen <its@irrelevant.dk> writes:
>>
>> > From: Klaus Jensen <k.jensen@samsung.com>
>> >
>> > Make nvme_check_constraints() return an int and fix incorrect use of
>> > errp/local_err.
>> >
>> > Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
>>
>> One more question: what exactly do you mean by "incorrect use of
>> errp/local_err"? Is it incorrect in the sense of "behaves badly", or
>> merely in the sense of "doesn't use the Error API the way it wants to be
>> used"?
>>
>
> It's the last hunk of the patch:
>
> @@ -7586,7 +7585,6 @@ static void nvme_realize(PCIDevice *pci_dev, Error **errp)
> &pci_dev->qdev, n->parent_obj.qdev.id);
>
> if (nvme_init_subsys(n, errp)) {
> - error_propagate(errp, local_err);
> return;
> }
>
> It propagates local_err (and it's NULL here).
Now I see, thanks!
Harmless, because error_propagate(errp, NULL) does nothing. Worth
cleaning up all the same.
> And the bug is a consequence of the error-prone use of an unneeded local
> error value.
Yes. Eliminating unnecessary error_propagate() tends to result in more
concise and clearer code.
next prev parent reply other threads:[~2022-11-09 13:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-09 10:53 [PATCH 0/2] hw/nvme: errp fixes Klaus Jensen
2022-11-09 10:53 ` [PATCH 1/2] hw/nvme: fix incorrect use of errp/local_err Klaus Jensen
2022-11-09 12:29 ` Markus Armbruster
2022-11-09 12:33 ` Klaus Jensen
2022-11-09 12:36 ` Markus Armbruster
2022-11-09 12:41 ` Klaus Jensen
2022-11-09 13:01 ` Markus Armbruster [this message]
2022-11-09 10:53 ` [PATCH 2/2] hw/nvme: cleanup error reporting in nvme_init_pci() Klaus Jensen
2022-11-09 12:33 ` Markus Armbruster
2022-11-09 12:35 ` Klaus Jensen
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=871qqcnuwz.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=its@irrelevant.dk \
--cc=k.jensen@samsung.com \
--cc=kbusch@kernel.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.