All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kurz <groug@kaod.org>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH v3 4/5] pci: Make is_bridge a bool
Date: Tue, 7 May 2019 12:02:21 +0200	[thread overview]
Message-ID: <20190507120221.772eae29@bahia.lan> (raw)
In-Reply-To: <20190507062316.20916-5-david@gibson.dropbear.id.au>

On Tue,  7 May 2019 16:23:15 +1000
David Gibson <david@gibson.dropbear.id.au> wrote:

> The is_bridge field in PCIDevice acts as a bool, but is declared as an int.
> Declare it as a bool for clarity, and change everything that writes it to
> use true/false instead of 0/1 to match.
> 

Reviewed-by: Greg Kurz <groug@kaod.org>

> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> ---
>  hw/pci-bridge/dec.c                | 4 ++--
>  hw/pci-bridge/i82801b11.c          | 2 +-
>  hw/pci-bridge/pci_bridge_dev.c     | 2 +-
>  hw/pci-bridge/pcie_pci_bridge.c    | 2 +-
>  hw/pci-bridge/pcie_root_port.c     | 2 +-
>  hw/pci-bridge/simba.c              | 2 +-
>  hw/pci-bridge/xio3130_downstream.c | 2 +-
>  hw/pci-bridge/xio3130_upstream.c   | 2 +-
>  include/hw/pci/pci.h               | 2 +-
>  9 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/hw/pci-bridge/dec.c b/hw/pci-bridge/dec.c
> index 8484bfd434..ca40253730 100644
> --- a/hw/pci-bridge/dec.c
> +++ b/hw/pci-bridge/dec.c
> @@ -68,7 +68,7 @@ static void dec_21154_pci_bridge_class_init(ObjectClass *klass, void *data)
>      k->vendor_id = PCI_VENDOR_ID_DEC;
>      k->device_id = PCI_DEVICE_ID_DEC_21154;
>      k->config_write = pci_bridge_write_config;
> -    k->is_bridge = 1;
> +    k->is_bridge = true;
>      dc->desc = "DEC 21154 PCI-PCI bridge";
>      dc->reset = pci_bridge_reset;
>      dc->vmsd = &vmstate_pci_device;
> @@ -129,7 +129,7 @@ static void dec_21154_pci_host_class_init(ObjectClass *klass, void *data)
>      k->device_id = PCI_DEVICE_ID_DEC_21154;
>      k->revision = 0x02;
>      k->class_id = PCI_CLASS_BRIDGE_PCI;
> -    k->is_bridge = 1;
> +    k->is_bridge = true;
>      /*
>       * PCI-facing part of the host bridge, not usable without the
>       * host-facing part, which can't be device_add'ed, yet.
> diff --git a/hw/pci-bridge/i82801b11.c b/hw/pci-bridge/i82801b11.c
> index 10e590e5c6..6d8b0f54a7 100644
> --- a/hw/pci-bridge/i82801b11.c
> +++ b/hw/pci-bridge/i82801b11.c
> @@ -90,7 +90,7 @@ static void i82801b11_bridge_class_init(ObjectClass *klass, void *data)
>      PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
>      DeviceClass *dc = DEVICE_CLASS(klass);
>  
> -    k->is_bridge = 1;
> +    k->is_bridge = true;
>      k->vendor_id = PCI_VENDOR_ID_INTEL;
>      k->device_id = PCI_DEVICE_ID_INTEL_82801BA_11;
>      k->revision = ICH9_D2P_A2_REVISION;
> diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c
> index ff6b8323da..c56ed1f52f 100644
> --- a/hw/pci-bridge/pci_bridge_dev.c
> +++ b/hw/pci-bridge/pci_bridge_dev.c
> @@ -253,7 +253,7 @@ static void pci_bridge_dev_class_init(ObjectClass *klass, void *data)
>      k->vendor_id = PCI_VENDOR_ID_REDHAT;
>      k->device_id = PCI_DEVICE_ID_REDHAT_BRIDGE;
>      k->class_id = PCI_CLASS_BRIDGE_PCI;
> -    k->is_bridge = 1,
> +    k->is_bridge = true;
>      dc->desc = "Standard PCI Bridge";
>      dc->reset = qdev_pci_bridge_dev_reset;
>      dc->props = pci_bridge_dev_properties;
> diff --git a/hw/pci-bridge/pcie_pci_bridge.c b/hw/pci-bridge/pcie_pci_bridge.c
> index d491b40d04..9a4fba413a 100644
> --- a/hw/pci-bridge/pcie_pci_bridge.c
> +++ b/hw/pci-bridge/pcie_pci_bridge.c
> @@ -143,7 +143,7 @@ static void pcie_pci_bridge_class_init(ObjectClass *klass, void *data)
>      DeviceClass *dc = DEVICE_CLASS(klass);
>      HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(klass);
>  
> -    k->is_bridge = 1;
> +    k->is_bridge = true;
>      k->vendor_id = PCI_VENDOR_ID_REDHAT;
>      k->device_id = PCI_DEVICE_ID_REDHAT_PCIE_BRIDGE;
>      k->realize = pcie_pci_bridge_realize;
> diff --git a/hw/pci-bridge/pcie_root_port.c b/hw/pci-bridge/pcie_root_port.c
> index e94d918b6d..be3f4d5e03 100644
> --- a/hw/pci-bridge/pcie_root_port.c
> +++ b/hw/pci-bridge/pcie_root_port.c
> @@ -162,7 +162,7 @@ static void rp_class_init(ObjectClass *klass, void *data)
>      DeviceClass *dc = DEVICE_CLASS(klass);
>      PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
>  
> -    k->is_bridge = 1;
> +    k->is_bridge = true;
>      k->config_write = rp_write_config;
>      k->realize = rp_realize;
>      k->exit = rp_exit;
> diff --git a/hw/pci-bridge/simba.c b/hw/pci-bridge/simba.c
> index dea4c8c5e7..7cf0d6e047 100644
> --- a/hw/pci-bridge/simba.c
> +++ b/hw/pci-bridge/simba.c
> @@ -76,7 +76,7 @@ static void simba_pci_bridge_class_init(ObjectClass *klass, void *data)
>      k->device_id = PCI_DEVICE_ID_SUN_SIMBA;
>      k->revision = 0x11;
>      k->config_write = pci_bridge_write_config;
> -    k->is_bridge = 1;
> +    k->is_bridge = true;
>      set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
>      dc->reset = pci_bridge_reset;
>      dc->vmsd = &vmstate_pci_device;
> diff --git a/hw/pci-bridge/xio3130_downstream.c b/hw/pci-bridge/xio3130_downstream.c
> index 467bbabe4c..ab2a51e15d 100644
> --- a/hw/pci-bridge/xio3130_downstream.c
> +++ b/hw/pci-bridge/xio3130_downstream.c
> @@ -152,7 +152,7 @@ static void xio3130_downstream_class_init(ObjectClass *klass, void *data)
>      DeviceClass *dc = DEVICE_CLASS(klass);
>      PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
>  
> -    k->is_bridge = 1;
> +    k->is_bridge = true;
>      k->config_write = xio3130_downstream_write_config;
>      k->realize = xio3130_downstream_realize;
>      k->exit = xio3130_downstream_exitfn;
> diff --git a/hw/pci-bridge/xio3130_upstream.c b/hw/pci-bridge/xio3130_upstream.c
> index b524908cf1..1d41a49ab0 100644
> --- a/hw/pci-bridge/xio3130_upstream.c
> +++ b/hw/pci-bridge/xio3130_upstream.c
> @@ -126,7 +126,7 @@ static void xio3130_upstream_class_init(ObjectClass *klass, void *data)
>      DeviceClass *dc = DEVICE_CLASS(klass);
>      PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
>  
> -    k->is_bridge = 1;
> +    k->is_bridge = true;
>      k->config_write = xio3130_upstream_write_config;
>      k->realize = xio3130_upstream_realize;
>      k->exit = xio3130_upstream_exitfn;
> diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
> index da20c915ef..d082707dfa 100644
> --- a/include/hw/pci/pci.h
> +++ b/include/hw/pci/pci.h
> @@ -234,7 +234,7 @@ typedef struct PCIDeviceClass {
>       * This doesn't mean pci host switch.
>       * When card bus bridge is supported, this would be enhanced.
>       */
> -    int is_bridge;
> +    bool is_bridge;
>  
>      /* rom bar */
>      const char *romfile;



  reply	other threads:[~2019-05-07 10:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07  6:23 [Qemu-devel] [PATCH v3 0/5] Simplify some not-really-necessary PCI bus callbacks David Gibson
2019-05-07  6:23 ` [Qemu-devel] [PATCH v3 1/5] pcie: Remove redundant test in pcie_mmcfg_data_{read, write}() David Gibson
2019-05-07  6:23 ` [Qemu-devel] [PATCH v3 2/5] pci: Simplify pci_bus_is_root() David Gibson
2019-05-07  6:23 ` [Qemu-devel] [PATCH v3 3/5] pcie: Simplify pci_adjust_config_limit() David Gibson
2019-05-07  6:23 ` [Qemu-devel] [PATCH v3 4/5] pci: Make is_bridge a bool David Gibson
2019-05-07 10:02   ` Greg Kurz [this message]
2019-05-07  6:23 ` [Qemu-devel] [PATCH v3 5/5] pci: Fold pci_get_bus_devfn() into its sole caller David Gibson
2019-05-07 10:21   ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2019-05-08  2:11     ` David Gibson

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=20190507120221.772eae29@bahia.lan \
    --to=groug@kaod.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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.