Skip to contentSkip to conversation

trivial: Do not include pci.h if it is not necessary

PATCH In review Thomas Huth 3 participants 3 messages Apr 30, 2018 – May 1, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trivial: Do not include pci.h if it is not necessary

There is no need to include pci.h in these files.

---
 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(-)
include/hw/ppc/ppc4xx.h +0 -2
index cb0bb55..3a2a04c 100644
@@ -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,
include/hw/virtio/virtio-balloon.h +0 -1
index 1ea13bd..e0df352 100644
@@ -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) \
include/hw/virtio/virtio-gpu.h +0 -1
index 22ac3c2..79bb3fb 100644
@@ -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"
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Thomas Huth

There is no need to include pci.h in these files.

Quoted 45 lines
---
 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(-)
include/hw/ppc/ppc4xx.h +0 -2
index cb0bb55..3a2a04c 100644
@@ -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,
include/hw/virtio/virtio-balloon.h +0 -1
index 1ea13bd..e0df352 100644
@@ -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) \
include/hw/virtio/virtio-gpu.h +0 -1
index 22ac3c2..79bb3fb 100644
@@ -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"
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#2 lore raw
In reply to Thomas Huth
Quoted 14 lines · Thomas Huth

There is no need to include pci.h in these files.

---
 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(-)
include/hw/ppc/ppc4xx.h +0 -0
index cb0bb55..3a2a04c 100644

include/hw/ppc/ppc4xx.h line 30

Quoted 8 lines
include/hw/ppc/ppc4xx.h +0 -2
@@ -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...

Quoted 18 lines
include/hw/virtio/virtio-balloon.h +0 -1
index 1ea13bd..e0df352 100644
@@ -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) \
include/hw/virtio/virtio-gpu.h +0 -0
index 22ac3c2..79bb3fb 100644

include/hw/virtio/virtio-gpu.h line 23

Quoted 7 lines
include/hw/virtio/virtio-gpu.h +0 -1
@@ -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: