Patchwork Re: [PATCH 02/20] pci: move pci_data_{read, write}() declaration from pci.h to pci_host.h

login
register
mail settings
Submitter Michael S. Tsirkin
Date Nov. 12, 2009, 12:44 p.m.
Message ID <20091112124438.GA11123@redhat.com>
Download mbox | patch
Permalink /patch/38245/
State New
Headers show

Comments

Michael S. Tsirkin - Nov. 12, 2009, 12:44 p.m.
On Thu, Nov 12, 2009 at 02:58:30PM +0900, Isaku Yamahata wrote:
> Now pci host stuff has been moved from pci.[hc] to pci_host.[hc]
> so the declaration of pci_data_{read, write}() should be in
> pci_host.h
> This patch moves them from pci.h to pci_host.h for consistency.
> 
> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
> ---
>  hw/pci.h      |    2 --
>  hw/pci_host.h |    3 +++
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/pci.h b/hw/pci.h
> index 9a56d0d..d3378d3 100644
> --- a/hw/pci.h
> +++ b/hw/pci.h
> @@ -293,8 +293,6 @@ PCIDevice *pci_nic_init(NICInfo *nd, const char *default_model,
>                          const char *default_devaddr);
>  PCIDevice *pci_nic_init_nofail(NICInfo *nd, const char *default_model,
>                                 const char *default_devaddr);
> -void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, int len);
> -uint32_t pci_data_read(PCIBus *s, uint32_t addr, int len);
>  int pci_bus_num(PCIBus *s);
>  void pci_for_each_device(PCIBus *bus, int bus_num, void (*fn)(PCIBus *bus, PCIDevice *d));
>  PCIBus *pci_find_host_bus(int domain);
> diff --git a/hw/pci_host.h b/hw/pci_host.h
> index e5e877f..7cfa693 100644
> --- a/hw/pci_host.h
> +++ b/hw/pci_host.h
> @@ -36,6 +36,9 @@ typedef struct {
>      PCIBus *bus;
>  } PCIHostState;
>  
> +void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, int len);
> +uint32_t pci_data_read(PCIBus *s, uint32_t addr, int len);
> +
>  /* for mmio */
>  int pci_host_config_register_io_memory(PCIHostState *s);
>  int pci_host_config_register_io_memory_noswap(PCIHostState *s);
> -- 
> 1.6.0.2


This breaks arm build (versatile_pci), ppc build (sh_pci).
I added #include "pci_host.h" there as well.

We end up with the following (this is on top of my cleanup patches):

--->

From: Isaku Yamahata <yamahata@valinux.co.jp>
Subject: pci: move pci_data_{read, write}() declaration from pci.h to pci_host.h
    
Now pci host stuff has been moved from pci.[hc] to pci_host.[hc]
so the declaration of pci_data_{read, write}() should be in
pci_host.h
This patch moves them from pci.h to pci_host.h for consistency.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Michael S. Tsirkin <mst@redhat.com>

---

Patch

diff --git a/hw/pci.h b/hw/pci.h
index c649cfe..686221b 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -293,8 +293,6 @@  PCIDevice *pci_nic_init(NICInfo *nd, const char *default_model,
                         const char *default_devaddr);
 PCIDevice *pci_nic_init_nofail(NICInfo *nd, const char *default_model,
                                const char *default_devaddr);
-void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, int len);
-uint32_t pci_data_read(PCIBus *s, uint32_t addr, int len);
 int pci_bus_num(PCIBus *s);
 void pci_for_each_device(PCIBus *bus, int bus_num, void (*fn)(PCIBus *bus, PCIDevice *d));
 PCIBus *pci_find_host_bus(int domain);
diff --git a/hw/pci_host.h b/hw/pci_host.h
index e5e877f..7cfa693 100644
--- a/hw/pci_host.h
+++ b/hw/pci_host.h
@@ -36,6 +36,9 @@  typedef struct {
     PCIBus *bus;
 } PCIHostState;
 
+void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, int len);
+uint32_t pci_data_read(PCIBus *s, uint32_t addr, int len);
+
 /* for mmio */
 int pci_host_config_register_io_memory(PCIHostState *s);
 int pci_host_config_register_io_memory_noswap(PCIHostState *s);
diff --git a/hw/sh_pci.c b/hw/sh_pci.c
index 52dc02e..abe4c75 100644
--- a/hw/sh_pci.c
+++ b/hw/sh_pci.c
@@ -24,6 +24,7 @@ 
 #include "hw.h"
 #include "sh.h"
 #include "pci.h"
+#include "pci_host.h"
 #include "sh_pci.h"
 #include "bswap.h"
 
diff --git a/hw/versatile_pci.c b/hw/versatile_pci.c
index a0d7d07..153c651 100644
--- a/hw/versatile_pci.c
+++ b/hw/versatile_pci.c
@@ -9,6 +9,7 @@ 
 
 #include "sysbus.h"
 #include "pci.h"
+#include "pci_host.h"
 
 typedef struct {
     SysBusDevice busdev;