[Qemu-devel] [PATCH] trivial: Do not include pci.h if it is not necessary

Thomas Huth posted 1 patch 7 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1525073539-27991-1-git-send-email-thuth@redhat.com
Test checkpatch passed
Test docker-build@min-glib passed
Test docker-mingw@fedora passed
Test s390x passed
include/hw/ppc/ppc4xx.h            | 2 --
include/hw/virtio/virtio-balloon.h | 1 -
include/hw/virtio/virtio-gpu.h     | 1 -
3 files changed, 4 deletions(-)
[Qemu-devel] [PATCH] trivial: Do not include pci.h if it is not necessary
Posted by Thomas Huth 7 years, 9 months ago
There is no need to include pci.h in these files.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 include/hw/ppc/ppc4xx.h            | 2 --
 include/hw/virtio/virtio-balloon.h | 1 -
 include/hw/virtio/virtio-gpu.h     | 1 -
 3 files changed, 4 deletions(-)

diff --git a/include/hw/ppc/ppc4xx.h b/include/hw/ppc/ppc4xx.h
index cb0bb55..3a2a04c 100644
--- a/include/hw/ppc/ppc4xx.h
+++ b/include/hw/ppc/ppc4xx.h
@@ -25,8 +25,6 @@
 #ifndef PPC4XX_H
 #define PPC4XX_H
 
-#include "hw/pci/pci.h"
-
 /* PowerPC 4xx core initialization */
 PowerPCCPU *ppc4xx_init(const char *cpu_model,
                         clk_setup_t *cpu_clk, clk_setup_t *tb_clk,
diff --git a/include/hw/virtio/virtio-balloon.h b/include/hw/virtio/virtio-balloon.h
index 1ea13bd..e0df352 100644
--- a/include/hw/virtio/virtio-balloon.h
+++ b/include/hw/virtio/virtio-balloon.h
@@ -17,7 +17,6 @@
 
 #include "standard-headers/linux/virtio_balloon.h"
 #include "hw/virtio/virtio.h"
-#include "hw/pci/pci.h"
 
 #define TYPE_VIRTIO_BALLOON "virtio-balloon-device"
 #define VIRTIO_BALLOON(obj) \
diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h
index 22ac3c2..79bb3fb 100644
--- a/include/hw/virtio/virtio-gpu.h
+++ b/include/hw/virtio/virtio-gpu.h
@@ -18,7 +18,6 @@
 #include "ui/qemu-pixman.h"
 #include "ui/console.h"
 #include "hw/virtio/virtio.h"
-#include "hw/pci/pci.h"
 #include "qemu/log.h"
 
 #include "standard-headers/linux/virtio_gpu.h"
-- 
1.8.3.1


Re: [Qemu-devel] [PATCH] trivial: Do not include pci.h if it is not necessary
Posted by Michael S. Tsirkin 7 years, 9 months ago
On Mon, Apr 30, 2018 at 09:32:19AM +0200, Thomas Huth wrote:
> There is no need to include pci.h in these files.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>

Reviewed-by: Michael S. Tsirkin <mst@redhat.com>

> ---
>  include/hw/ppc/ppc4xx.h            | 2 --
>  include/hw/virtio/virtio-balloon.h | 1 -
>  include/hw/virtio/virtio-gpu.h     | 1 -
>  3 files changed, 4 deletions(-)
> 
> diff --git a/include/hw/ppc/ppc4xx.h b/include/hw/ppc/ppc4xx.h
> index cb0bb55..3a2a04c 100644
> --- a/include/hw/ppc/ppc4xx.h
> +++ b/include/hw/ppc/ppc4xx.h
> @@ -25,8 +25,6 @@
>  #ifndef PPC4XX_H
>  #define PPC4XX_H
>  
> -#include "hw/pci/pci.h"
> -
>  /* PowerPC 4xx core initialization */
>  PowerPCCPU *ppc4xx_init(const char *cpu_model,
>                          clk_setup_t *cpu_clk, clk_setup_t *tb_clk,
> diff --git a/include/hw/virtio/virtio-balloon.h b/include/hw/virtio/virtio-balloon.h
> index 1ea13bd..e0df352 100644
> --- a/include/hw/virtio/virtio-balloon.h
> +++ b/include/hw/virtio/virtio-balloon.h
> @@ -17,7 +17,6 @@
>  
>  #include "standard-headers/linux/virtio_balloon.h"
>  #include "hw/virtio/virtio.h"
> -#include "hw/pci/pci.h"
>  
>  #define TYPE_VIRTIO_BALLOON "virtio-balloon-device"
>  #define VIRTIO_BALLOON(obj) \
> diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h
> index 22ac3c2..79bb3fb 100644
> --- a/include/hw/virtio/virtio-gpu.h
> +++ b/include/hw/virtio/virtio-gpu.h
> @@ -18,7 +18,6 @@
>  #include "ui/qemu-pixman.h"
>  #include "ui/console.h"
>  #include "hw/virtio/virtio.h"
> -#include "hw/pci/pci.h"
>  #include "qemu/log.h"
>  
>  #include "standard-headers/linux/virtio_gpu.h"
> -- 
> 1.8.3.1

Re: [Qemu-devel] [PATCH] trivial: Do not include pci.h if it is not necessary
Posted by Philippe Mathieu-Daudé 7 years, 9 months ago
On 04/30/2018 04:32 AM, Thomas Huth wrote:
> There is no need to include pci.h in these files.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  include/hw/ppc/ppc4xx.h            | 2 --
>  include/hw/virtio/virtio-balloon.h | 1 -
>  include/hw/virtio/virtio-gpu.h     | 1 -
>  3 files changed, 4 deletions(-)
> 
> diff --git a/include/hw/ppc/ppc4xx.h b/include/hw/ppc/ppc4xx.h
> index cb0bb55..3a2a04c 100644
> --- a/include/hw/ppc/ppc4xx.h
> +++ b/include/hw/ppc/ppc4xx.h
> @@ -25,8 +25,6 @@
>  #ifndef PPC4XX_H
>  #define PPC4XX_H
>  
> -#include "hw/pci/pci.h"
> -
>  /* PowerPC 4xx core initialization */
>  PowerPCCPU *ppc4xx_init(const char *cpu_model,
>                          clk_setup_t *cpu_clk, clk_setup_t *tb_clk,

"ppc4xx.h" misses various includes...

> diff --git a/include/hw/virtio/virtio-balloon.h b/include/hw/virtio/virtio-balloon.h
> index 1ea13bd..e0df352 100644
> --- a/include/hw/virtio/virtio-balloon.h
> +++ b/include/hw/virtio/virtio-balloon.h
> @@ -17,7 +17,6 @@
>  
>  #include "standard-headers/linux/virtio_balloon.h"
>  #include "hw/virtio/virtio.h"
> -#include "hw/pci/pci.h"
>  
>  #define TYPE_VIRTIO_BALLOON "virtio-balloon-device"
>  #define VIRTIO_BALLOON(obj) \
> diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h
> index 22ac3c2..79bb3fb 100644
> --- a/include/hw/virtio/virtio-gpu.h
> +++ b/include/hw/virtio/virtio-gpu.h
> @@ -18,7 +18,6 @@
>  #include "ui/qemu-pixman.h"
>  #include "ui/console.h"
>  #include "hw/virtio/virtio.h"
> -#include "hw/pci/pci.h"
>  #include "qemu/log.h"
>  
>  #include "standard-headers/linux/virtio_gpu.h"
> 

Weirdness of virtio-gpu.h, it uses VIRTIO_PCI_FLAG_USE_IOEVENTFD which
is defined in the local hw/virtio/virtio-pci.h (local = not under include/)

Anyway any of those requires "hw/pci/pci.h", so:
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>