qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Subject: Re: [PATCH 2/4] hw: Replace dev->parent_bus by qdev_get_parent_bus(dev)
Date: Mon, 13 Feb 2023 13:19:36 -1000	[thread overview]
Message-ID: <0c477def-e852-53e3-9bf0-a9e3c313cf25@linaro.org> (raw)
In-Reply-To: <88026156-1838-bb8e-c637-b59a26759cc3@linaro.org>

On 2/12/23 13:03, Philippe Mathieu-Daudé wrote:
> On 12/2/23 23:47, Philippe Mathieu-Daudé wrote:
>> DeviceState::parent_bus is an internal field and should be
>> accessed by the qdev_get_parent_bus() helper. Replace all
>> uses in hw/ except the QDev uses in hw/core/.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>>   hw/audio/intel-hda.c                |  2 +-
>>   hw/block/fdc.c                      |  2 +-
>>   hw/block/swim.c                     |  2 +-
>>   hw/ide/qdev.c                       |  4 ++--
>>   hw/net/virtio-net.c                 |  2 +-
>>   hw/pci-bridge/pci_expander_bridge.c |  2 +-
>>   hw/scsi/scsi-bus.c                  |  2 +-
>>   hw/usb/bus.c                        |  2 +-
>>   hw/usb/desc.c                       |  2 +-
>>   hw/usb/dev-smartcard-reader.c       | 16 ++++++++--------
>>   10 files changed, 18 insertions(+), 18 deletions(-)
> 
> I missed:

Did you use a temporary rename of the field to catch all the uses?

>   void hda_codec_response(HDACodecDevice *dev, bool solicited, uint32_t response)
>   {
> -    HDACodecBus *bus = HDA_BUS(dev->qdev.parent_bus);
> +    HDACodecBus *bus = HDA_BUS(qdev_get_parent_bus(DEVICE(dev)));

I'm never sure the cast is clearer than &dev->qdev.
But it seems the normal way in qemu...

Acked-by: Richard Henderson <richard.henderson@linaro.org>


r~



  reply	other threads:[~2023-02-13 23:20 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 [this message]
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
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=0c477def-e852-53e3-9bf0-a9e3c313cf25@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=philmd@linaro.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).