From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, "Gonglei (Arei)" <arei.gonglei@huawei.com>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Laurent Vivier" <laurent@vivier.eu>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>
Subject: Re: [PATCH 3/4] hw: Use qdev_get_parent_bus() in qdev_get_own_fw_dev_path_from_handler()
Date: Mon, 13 Feb 2023 13:29:43 -1000 [thread overview]
Message-ID: <cc4aa3f3-910e-09f5-e326-7ef5a6f80569@linaro.org> (raw)
In-Reply-To: <20230212224730.51438-4-philmd@linaro.org>
On 2/12/23 12:47, Philippe Mathieu-Daudé wrote:
> -static char *qdev_get_fw_dev_path_from_handler(BusState *bus, DeviceState *dev)
> +static char *qdev_get_fw_dev_path_from_handler(DeviceState *dev)
> {
> Object *obj = OBJECT(dev);
> + BusState *bus = qdev_get_parent_bus(dev);
> char *d = NULL;
>
> while (!d && obj->parent) {
This is a separate change from...
> -char *qdev_get_own_fw_dev_path_from_handler(BusState *bus, DeviceState *dev)
> +char *qdev_get_own_fw_dev_path_from_handler(DeviceState *dev)
> {
> Object *obj = OBJECT(dev);
>
> - return fw_path_provider_try_get_dev_path(obj, bus, dev);
> + return fw_path_provider_try_get_dev_path(obj, qdev_get_parent_bus(dev), dev);
... this, which is what $SUBJECT says.
> @@ -67,7 +68,7 @@ static int qdev_get_fw_dev_path_helper(DeviceState *dev, char *p, int size)
> if (dev && dev->parent_bus) {
> char *d;
> l = qdev_get_fw_dev_path_helper(dev->parent_bus->parent, p, size);
> - d = qdev_get_fw_dev_path_from_handler(dev->parent_bus, dev);
> + d = qdev_get_fw_dev_path_from_handler(dev);
We've already accessed parent_bus just above
> if (!d) {
> d = bus_get_fw_dev_path(dev->parent_bus, dev);
... and just below. So, what's the cleanup?
r~
next prev parent reply other threads:[~2023-02-13 23:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-12 22:47 [PATCH 0/4] hw/qdev: Housekeeping around qdev_get_parent_bus() Philippe Mathieu-Daudé
2023-02-12 22:47 ` [PATCH 1/4] hw/qdev: Constify DeviceState* argument of qdev_get_parent_bus() Philippe Mathieu-Daudé
2023-02-13 22:55 ` Richard Henderson
2023-02-12 22:47 ` [PATCH 2/4] hw: Replace dev->parent_bus by qdev_get_parent_bus(dev) Philippe Mathieu-Daudé
2023-02-12 23:03 ` Philippe Mathieu-Daudé
2023-02-13 23:19 ` Richard Henderson
2023-02-14 11:33 ` Philippe Mathieu-Daudé
2023-02-12 22:47 ` [PATCH 3/4] hw: Use qdev_get_parent_bus() in qdev_get_own_fw_dev_path_from_handler() Philippe Mathieu-Daudé
2023-02-13 23:29 ` Richard Henderson [this message]
2023-02-14 11:26 ` Philippe Mathieu-Daudé
2023-02-12 22:47 ` [PATCH 4/4] qdev-monitor: Use qdev_get_parent_bus() in bus_print_dev() Philippe Mathieu-Daudé
2023-02-13 23:31 ` Richard Henderson
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=cc4aa3f3-910e-09f5-e326-7ef5a6f80569@linaro.org \
--to=richard.henderson@linaro.org \
--cc=arei.gonglei@huawei.com \
--cc=berrange@redhat.com \
--cc=eduardo@habkost.net \
--cc=laurent@vivier.eu \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).