qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: deller@kernel.org, qemu-devel@nongnu.org
Cc: Helge Deller <deller@gmx.de>,
	Soumyajyotii Ssarkar <soumyajyotisarkar23@gmail.com>
Subject: Re: [PATCH 08/10] hw/hppa: PCI devices depend on availability of PCI bus
Date: Wed, 22 Oct 2025 13:59:55 -0500	[thread overview]
Message-ID: <c572407c-0c9f-4ce7-b8ed-e7f8929d957d@linaro.org> (raw)
In-Reply-To: <20251017200653.23337-9-deller@kernel.org>

On 10/17/25 15:06, deller@kernel.org wrote:
> From: Helge Deller <deller@gmx.de>
> 
> Only create the PCI serial ports (DIVA) and PCI network cards when there is
> actually a PCI bus. The shortly added 715 machine will not have a PCI bus, so
> avoid creating further PCI devices.
> 
> Signed-off-by: Helge Deller <deller@gmx.de>
> ---
>   hw/hppa/machine.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
> index bec5a86f24..b6cdbc74ba 100644
> --- a/hw/hppa/machine.c
> +++ b/hw/hppa/machine.c
> @@ -387,11 +387,13 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
>                           enable_lasi_lan());
>       }
>   
> -    pci_init_nic_devices(pci_bus, mc->default_nic);
> +    if (pci_bus) {
> +        pci_init_nic_devices(pci_bus, mc->default_nic);
> +    }
>   
>       /* BMC board: HP Diva GSP */
> -    dev = qdev_new("diva-gsp");
> -    if (!object_property_get_bool(OBJECT(dev), "disable", NULL)) {
> +    dev = pci_bus ? qdev_new("diva-gsp") : NULL;
> +    if (dev && !object_property_get_bool(OBJECT(dev), "disable", NULL)) {

Sequential testing of NULL pointers isn't ideal.

Better as

     if (pci_bus) {
	pci_init_nic_devices(pci_bus, mc->default_nic);

	/* BMC board: HP Diva GSP */
	dev = qdev_new("diva-gsp");
	if (!object_property_get_bool(OBJECT(dev), "disable", NULL)) {
	    PCIDevice *pci_dev = pci_new_multifunction(...);
	}
     }


r~


  reply	other threads:[~2025-10-22 19:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-17 20:06 [PATCH 00/10] HP-PARISC 715 machine with NCR710 SCSI chip deller
2025-10-17 20:06 ` [PATCH 02/10] ncr710: Add driver for the NCR 53c710 " deller
2025-10-22 10:57   ` [PATCH v3 #2a/10] Adding LASI's NCR710 SCSI Controller Wrapper Soumyajyotii Ssarkar
2025-10-22 10:57   ` [PATCH v3 #2b/10] Adding NCR710 SCSI Controller Core logic Soumyajyotii Ssarkar
2025-10-22 19:20   ` [PATCH 02/10] ncr710: Add driver for the NCR 53c710 SCSI chip Philippe Mathieu-Daudé
2025-10-22 20:00     ` Soumyajyotii Ssarkar
2025-10-17 20:06 ` [PATCH 03/10] lasi: Forward LASI SCSI ports to NCR 53c710 driver deller
2025-10-17 20:06 ` [PATCH 04/10] hw/scsi: Add config option for new ncr710 driver deller
2025-10-22 18:49   ` Richard Henderson
2025-10-17 20:06 ` [PATCH 05/10] hw/hppa: Fix firmware end address for LASI chip deller
2025-10-22 18:50   ` Richard Henderson
2025-10-17 20:06 ` [PATCH 06/10] hw/hppa: Fix interrupt of LASI parallel port deller
2025-10-22 18:50   ` Richard Henderson
2025-10-17 20:06 ` [PATCH 07/10] hw/hppa: Add the NCR 710 SCSI driver to hppa machines deller
2025-10-22 18:52   ` Richard Henderson
2025-10-17 20:06 ` [PATCH 08/10] hw/hppa: PCI devices depend on availability of PCI bus deller
2025-10-22 18:59   ` Richard Henderson [this message]
2025-10-17 20:06 ` [PATCH 09/10] hw/hppa: Require SeaBIOS version 19 for 715 machine deller
2025-10-22 19:00   ` Richard Henderson
2025-10-17 20:06 ` [PATCH 10/10] hw/hppa: Add 715 machine type including NCR710 SCSI deller
2025-10-22 19:10   ` 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=c572407c-0c9f-4ce7-b8ed-e7f8929d957d@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=deller@gmx.de \
    --cc=deller@kernel.org \
    --cc=qemu-devel@nongnu.org \
    --cc=soumyajyotisarkar23@gmail.com \
    /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).