Skip to contentSkip to conversation

Clean up includes

PATCH Applied Peter Maydell 8 participants 36 messages Jan 25, 2024 – Jan 31, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover Clean up includes

This series makes a bunch of automated edits with the clean-includes script. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

I created the series by looking at a run of the script across the whole tree (./scripts/clean-includes --git includes --all) produces, and then disentangling that into (a) different cohesive parts and (b) files that needed to go into the script's exclude-list.

After this series, the tree is still not entirely clean -- there are 20 other files the script wants to change. But at least some of them are things that should be on the exclude list, and some are things which I didn't feel like taking the time to try to decide whether they should be fixed or excluded. I might come back to these at some later date, but I figured this series was enough to be going on with.

thanks
-- PMM

Peter Maydell (10):
scripts/clean-includes: Update exclude list
hyperv: Clean up includes
disas/riscv: Clean up includes
aspeed: Clean up includes
acpi: Clean up includes
m68k: Clean up includes
include: Clean up includes
cxl: Clean up includes
riscv: Clean up includes
misc: Clean up includes

 disas/riscv.h                             | 1 -
 hw/arm/aspeed_eeprom.h                    | 1 -
 hw/hyperv/hv-balloon-internal.h           | 1 -
 hw/hyperv/hv-balloon-our_range_memslots.h | 1 -
 hw/hyperv/hv-balloon-page_range_tree.h    | 1 -
 include/hw/arm/raspberrypi-fw-defs.h      | 1 -
 include/hw/audio/asc.h                    | 1 -
 include/hw/m68k/q800-glue.h               | 1 -
 include/hw/mem/memory-device.h            | 1 -
 include/hw/nvram/fw_cfg_acpi.h            | 1 -
 include/hw/ppc/spapr_nested.h             | 1 -
 include/hw/virtio/virtio-acpi.h           | 1 -
 include/hw/xen/xen-hvm-common.h           | 1 -
 include/qemu/qtree.h                      | 1 -
 include/ui/rect.h                         | 2 --
 target/riscv/vector_internals.h           | 1 -
 tests/qtest/qtest_aspeed.h                | 2 --
 audio/pwaudio.c                           | 1 -
 disas/riscv-xthead.c                      | 1 +
 disas/riscv-xventana.c                    | 1 +
 hw/arm/aspeed_eeprom.c                    | 1 +
 hw/cxl/cxl-events.c                       | 4 +---
 hw/hyperv/hv-balloon-our_range_memslots.c | 1 +
 hw/hyperv/hv-balloon-page_range_tree.c    | 1 +
 hw/hyperv/hv-balloon.c                    | 1 +
 hw/nvram/fw_cfg-acpi.c                    | 1 +
 hw/virtio/virtio-acpi.c                   | 1 +
 net/af-xdp.c                              | 1 -
 plugins/core.c                            | 1 -
 plugins/loader.c                          | 1 -
 target/riscv/vector_internals.c           | 1 +
 util/userfaultfd.c                        | 1 -
 scripts/clean-includes                    | 2 +-
 33 files changed, 11 insertions(+), 28 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/10 scripts/clean-includes: Update exclude list

Update the exclude list to exclude some more files which don't follow our standard #include policy.

---
 scripts/clean-includes | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/clean-includes +1 -1
index 58e1607a82e..bdbf4040240 100755
@@ -51,7 +51,7 @@ GIT=no
 DUPHEAD=no
 
 # Extended regular expression defining files to ignore when using --all
-XDIRREGEX='^(tests/tcg|tests/multiboot|pc-bios)'
+XDIRREGEX='^(tests/tcg|tests/multiboot|tests/fp|tests/plugin|tests/uefi-test-tools|pc-bios|subprojects|contrib/plugins|tools/ebpf|ebpf/rss.bpf.skeleton.h|linux-user/(mips64|x86_64)/(cpu_loop|signal).c)'
 
 while true
 do
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/10 hyperv: Clean up includes

In reply to Peter Maydell

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git hyperv hw/hyperv/*.[ch]

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

---
 hw/hyperv/hv-balloon-internal.h           | 1 -
 hw/hyperv/hv-balloon-our_range_memslots.h | 1 -
 hw/hyperv/hv-balloon-page_range_tree.h    | 1 -
 hw/hyperv/hv-balloon-our_range_memslots.c | 1 +
 hw/hyperv/hv-balloon-page_range_tree.c    | 1 +
 hw/hyperv/hv-balloon.c                    | 1 +
 6 files changed, 3 insertions(+), 3 deletions(-)
hw/hyperv/hv-balloon-internal.h +0 -1
index 164c2e58253..ee53a28a266 100644
@@ -10,7 +10,6 @@
 #ifndef HW_HYPERV_HV_BALLOON_INTERNAL_H
 #define HW_HYPERV_HV_BALLOON_INTERNAL_H
 
-#include "qemu/osdep.h"
 
 #define HV_BALLOON_PFN_SHIFT 12
 #define HV_BALLOON_PAGE_SIZE (1 << HV_BALLOON_PFN_SHIFT)
hw/hyperv/hv-balloon-our_range_memslots.h +0 -1
index b6f592d34b0..df3b686bc7c 100644
@@ -10,7 +10,6 @@
 #ifndef HW_HYPERV_HV_BALLOON_OUR_RANGE_MEMSLOTS_H
 #define HW_HYPERV_HV_BALLOON_OUR_RANGE_MEMSLOTS_H
 
-#include "qemu/osdep.h"
 
 #include "exec/memory.h"
 #include "qom/object.h"
hw/hyperv/hv-balloon-page_range_tree.h +0 -1
index 07a9ae0da61..333772b86d2 100644
@@ -10,7 +10,6 @@
 #ifndef HW_HYPERV_HV_BALLOON_PAGE_RANGE_TREE_H
 #define HW_HYPERV_HV_BALLOON_PAGE_RANGE_TREE_H
 
-#include "qemu/osdep.h"
 
 /* PageRange */
 typedef struct PageRange {
hw/hyperv/hv-balloon-our_range_memslots.c +1 -0
index 99bae870f37..1505a395cf7 100644
@@ -7,6 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "hv-balloon-internal.h"
 #include "hv-balloon-our_range_memslots.h"
 #include "trace.h"
hw/hyperv/hv-balloon-page_range_tree.c +1 -0
index e178d8b413c..dfb14852f42 100644
@@ -7,6 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "hv-balloon-internal.h"
 #include "hv-balloon-page_range_tree.h"
 
hw/hyperv/hv-balloon.c +1 -0
index 66f297c1d7e..02383657124 100644
@@ -7,6 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "hv-balloon-internal.h"
 
 #include "exec/address-spaces.h"
Signature · 1 line
2.34.1
Reviewed-by on v1 2/10
#3 lore raw

Re: [PATCH 02/10] hyperv: Clean up includes

Quoted 18 lines · Peter Maydell

Date: Thu, 25 Jan 2024 16:34:00 +0000
From: Peter Maydell <[email protected]>
Subject: [PATCH 02/10] hyperv: Clean up includes
X-Mailer: git-send-email 2.34.1

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git hyperv hw/hyperv/*.[ch]

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

Quoted 8 lines
---
 hw/hyperv/hv-balloon-internal.h           | 1 -
 hw/hyperv/hv-balloon-our_range_memslots.h | 1 -
 hw/hyperv/hv-balloon-page_range_tree.h    | 1 -
 hw/hyperv/hv-balloon-our_range_memslots.c | 1 +
 hw/hyperv/hv-balloon-page_range_tree.c    | 1 +
 hw/hyperv/hv-balloon.c                    | 1 +
 6 files changed, 3 insertions(+), 3 deletions(-)
Quoted 77 lines
hw/hyperv/hv-balloon-internal.h +0 -1
index 164c2e58253..ee53a28a266 100644
@@ -10,7 +10,6 @@
 #ifndef HW_HYPERV_HV_BALLOON_INTERNAL_H
 #define HW_HYPERV_HV_BALLOON_INTERNAL_H
 
-#include "qemu/osdep.h"
 
 #define HV_BALLOON_PFN_SHIFT 12
 #define HV_BALLOON_PAGE_SIZE (1 << HV_BALLOON_PFN_SHIFT)
hw/hyperv/hv-balloon-our_range_memslots.h +0 -1
index b6f592d34b0..df3b686bc7c 100644
@@ -10,7 +10,6 @@
 #ifndef HW_HYPERV_HV_BALLOON_OUR_RANGE_MEMSLOTS_H
 #define HW_HYPERV_HV_BALLOON_OUR_RANGE_MEMSLOTS_H
 
-#include "qemu/osdep.h"
 
 #include "exec/memory.h"
 #include "qom/object.h"
hw/hyperv/hv-balloon-page_range_tree.h +0 -1
index 07a9ae0da61..333772b86d2 100644
@@ -10,7 +10,6 @@
 #ifndef HW_HYPERV_HV_BALLOON_PAGE_RANGE_TREE_H
 #define HW_HYPERV_HV_BALLOON_PAGE_RANGE_TREE_H
 
-#include "qemu/osdep.h"
 
 /* PageRange */
 typedef struct PageRange {
hw/hyperv/hv-balloon-our_range_memslots.c +1 -0
index 99bae870f37..1505a395cf7 100644
@@ -7,6 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "hv-balloon-internal.h"
 #include "hv-balloon-our_range_memslots.h"
 #include "trace.h"
hw/hyperv/hv-balloon-page_range_tree.c +1 -0
index e178d8b413c..dfb14852f42 100644
@@ -7,6 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "hv-balloon-internal.h"
 #include "hv-balloon-page_range_tree.h"
 
hw/hyperv/hv-balloon.c +1 -0
index 66f297c1d7e..02383657124 100644
@@ -7,6 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "hv-balloon-internal.h"
 
 #include "exec/address-spaces.h"
Signature · 1 line
2.34.1
Reviewed-by on v1 2/10
#4 lore raw

Re: [PATCH 02/10] hyperv: Clean up includes

In reply to Peter Maydell
Quoted 13 lines · Peter Maydell

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git hyperv hw/hyperv/*.[ch]

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

Quoted 8 lines
---
  hw/hyperv/hv-balloon-internal.h           | 1 -
  hw/hyperv/hv-balloon-our_range_memslots.h | 1 -
  hw/hyperv/hv-balloon-page_range_tree.h    | 1 -
  hw/hyperv/hv-balloon-our_range_memslots.c | 1 +
  hw/hyperv/hv-balloon-page_range_tree.c    | 1 +
  hw/hyperv/hv-balloon.c                    | 1 +
  6 files changed, 3 insertions(+), 3 deletions(-)

r~

#5 lore raw

PATCH 3/10 disas/riscv: Clean up includes

In reply to Peter Maydell

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git disas/riscv disas/riscv*[ch]

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

---
 disas/riscv.h          | 1 -
 disas/riscv-xthead.c   | 1 +
 disas/riscv-xventana.c | 1 +
 3 files changed, 2 insertions(+), 1 deletion(-)
disas/riscv.h +0 -1
index 19e5ed2ce63..16a08e4895c 100644
@@ -7,7 +7,6 @@
 #ifndef DISAS_RISCV_H
 #define DISAS_RISCV_H
 
-#include "qemu/osdep.h"
 #include "target/riscv/cpu_cfg.h"
 
 /* types */
disas/riscv-xthead.c +1 -0
index 99da679d16c..fcca326d1c3 100644
@@ -4,6 +4,7 @@
  * SPDX-License-Identifier: GPL-2.0-or-later
  */
 
+#include "qemu/osdep.h"
 #include "disas/riscv.h"
 #include "disas/riscv-xthead.h"
 
disas/riscv-xventana.c +1 -0
index a0224d1fb31..cd694f15f32 100644
@@ -4,6 +4,7 @@
  * SPDX-License-Identifier: GPL-2.0-or-later
  */
 
+#include "qemu/osdep.h"
 #include "disas/riscv.h"
 #include "disas/riscv-xventana.h"
 
Signature · 1 line
2.34.1
Reviewed-by on v1 3/10
#6 lore raw

Re: [PATCH 03/10] disas/riscv: Clean up includes

Quoted 12 lines · Peter Maydell

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git disas/riscv disas/riscv*[ch]

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

Quoted 6 lines
---
  disas/riscv.h          | 1 -
  disas/riscv-xthead.c   | 1 +
  disas/riscv-xventana.c | 1 +
  3 files changed, 2 insertions(+), 1 deletion(-)
Reviewed-by on v1 3/10
#7 lore raw

Re: [PATCH 03/10] disas/riscv: Clean up includes

In reply to Peter Maydell
Quoted 17 lines · Peter Maydell

Date: Thu, 25 Jan 2024 16:34:01 +0000
From: Peter Maydell <[email protected]>
Subject: [PATCH 03/10] disas/riscv: Clean up includes
X-Mailer: git-send-email 2.34.1

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git disas/riscv disas/riscv*[ch]

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

Quoted 6 lines
---
 disas/riscv.h          | 1 -
 disas/riscv-xthead.c   | 1 +
 disas/riscv-xventana.c | 1 +
 3 files changed, 2 insertions(+), 1 deletion(-)
Quoted 41 lines
disas/riscv.h +0 -1
index 19e5ed2ce63..16a08e4895c 100644
@@ -7,7 +7,6 @@
 #ifndef DISAS_RISCV_H
 #define DISAS_RISCV_H
 
-#include "qemu/osdep.h"
 #include "target/riscv/cpu_cfg.h"
 
 /* types */
disas/riscv-xthead.c +1 -0
index 99da679d16c..fcca326d1c3 100644
@@ -4,6 +4,7 @@
  * SPDX-License-Identifier: GPL-2.0-or-later
  */
 
+#include "qemu/osdep.h"
 #include "disas/riscv.h"
 #include "disas/riscv-xthead.h"
 
disas/riscv-xventana.c +1 -0
index a0224d1fb31..cd694f15f32 100644
@@ -4,6 +4,7 @@
  * SPDX-License-Identifier: GPL-2.0-or-later
  */
 
+#include "qemu/osdep.h"
 #include "disas/riscv.h"
 #include "disas/riscv-xventana.h"
 
Signature · 1 line
2.34.1
Reviewed-by on v1 3/10
#8 lore raw

Re: [PATCH 03/10] disas/riscv: Clean up includes

In reply to Peter Maydell
Quoted 12 lines · Peter Maydell

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git disas/riscv disas/riscv*[ch]

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

Quoted 6 lines
---
  disas/riscv.h          | 1 -
  disas/riscv-xthead.c   | 1 +
  disas/riscv-xventana.c | 1 +
  3 files changed, 2 insertions(+), 1 deletion(-)

r~

Reviewed-by on v1 3/10
#9 lore raw

Re: [PATCH 03/10] disas/riscv: Clean up includes

In reply to Peter Maydell
Quoted 7 lines · Peter Maydell

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git disas/riscv disas/riscv*[ch]

All .c should include qemu/osdep.h first. The script performs three related cleanups:

Quoted 7 lines

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

Alistair

Quoted 46 lines
---
 disas/riscv.h          | 1 -
 disas/riscv-xthead.c   | 1 +
 disas/riscv-xventana.c | 1 +
 3 files changed, 2 insertions(+), 1 deletion(-)
disas/riscv.h +0 -1
index 19e5ed2ce63..16a08e4895c 100644
@@ -7,7 +7,6 @@
 #ifndef DISAS_RISCV_H
 #define DISAS_RISCV_H
 
-#include "qemu/osdep.h"
 #include "target/riscv/cpu_cfg.h"
 
 /* types */
disas/riscv-xthead.c +1 -0
index 99da679d16c..fcca326d1c3 100644
@@ -4,6 +4,7 @@
  * SPDX-License-Identifier: GPL-2.0-or-later
  */
 
+#include "qemu/osdep.h"
 #include "disas/riscv.h"
 #include "disas/riscv-xthead.h"
 
disas/riscv-xventana.c +1 -1
index a0224d1fb31..cd694f15f32 100644
@@ -4,6 +4,7 @@
  * SPDX-License-Identifier: GPL-2.0-or-later
  */
 
+#include "qemu/osdep.h"
 #include "disas/riscv.h"
 #include "disas/riscv-xventana.h"
 
--

2.34.1

#10 lore raw

PATCH 4/10 aspeed: Clean up includes

In reply to Peter Maydell

This commit was created with scripts/clean-includes.

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

---
 hw/arm/aspeed_eeprom.h     | 1 -
 tests/qtest/qtest_aspeed.h | 2 --
 hw/arm/aspeed_eeprom.c     | 1 +
 3 files changed, 1 insertion(+), 3 deletions(-)
hw/arm/aspeed_eeprom.h +0 -1
index bbf9e54365b..f08c16ef506 100644
@@ -7,7 +7,6 @@
 #ifndef ASPEED_EEPROM_H
 #define ASPEED_EEPROM_H
 
-#include "qemu/osdep.h"
 
 extern const uint8_t tiogapass_bmc_fruid[];
 extern const size_t tiogapass_bmc_fruid_len;
tests/qtest/qtest_aspeed.h +0 -2
index 235dfaa186a..d35b0c7cba5 100644
@@ -12,8 +12,6 @@
 #ifndef QTEST_ASPEED_H
 #define QTEST_ASPEED_H
 
-#include <stdint.h>
-
 #include "libqtest.h"
 
 #define AST2600_ASPEED_I2C_BASE_ADDR 0x1e78a000
hw/arm/aspeed_eeprom.c +1 -0
index ace5266cec9..daa3d329d10 100644
@@ -4,6 +4,7 @@
  * SPDX-License-Identifier: GPL-2.0-only
  */
 
+#include "qemu/osdep.h"
 #include "aspeed_eeprom.h"
 
 /* Tiogapass BMC FRU */
Signature · 1 line
2.34.1
Reviewed-by on v1 4/10
#11 lore raw

Re: [PATCH 04/10] aspeed: Clean up includes

Quoted 11 lines · Peter Maydell

This commit was created with scripts/clean-includes.

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

Quoted 6 lines
---
  hw/arm/aspeed_eeprom.h     | 1 -
  tests/qtest/qtest_aspeed.h | 2 --
  hw/arm/aspeed_eeprom.c     | 1 +
  3 files changed, 1 insertion(+), 3 deletions(-)
Reviewed-by on v1 4/10
#12 lore raw

Re: [PATCH 04/10] aspeed: Clean up includes

In reply to Peter Maydell
Quoted 53 lines · Peter Maydell

Date: Thu, 25 Jan 2024 16:34:02 +0000
From: Peter Maydell <[email protected]>
Subject: [PATCH 04/10] aspeed: Clean up includes
X-Mailer: git-send-email 2.34.1

This commit was created with scripts/clean-includes.

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

---
 hw/arm/aspeed_eeprom.h     | 1 -
 tests/qtest/qtest_aspeed.h | 2 --
 hw/arm/aspeed_eeprom.c     | 1 +
 3 files changed, 1 insertion(+), 3 deletions(-)
hw/arm/aspeed_eeprom.h +0 -1
index bbf9e54365b..f08c16ef506 100644
@@ -7,7 +7,6 @@
 #ifndef ASPEED_EEPROM_H
 #define ASPEED_EEPROM_H
 
-#include "qemu/osdep.h"
 
 extern const uint8_t tiogapass_bmc_fruid[];
 extern const size_t tiogapass_bmc_fruid_len;
tests/qtest/qtest_aspeed.h +0 -2
index 235dfaa186a..d35b0c7cba5 100644
@@ -12,8 +12,6 @@
 #ifndef QTEST_ASPEED_H
 #define QTEST_ASPEED_H
 
-#include <stdint.h>
-
 #include "libqtest.h"
 
 #define AST2600_ASPEED_I2C_BASE_ADDR 0x1e78a000
hw/arm/aspeed_eeprom.c +0 -0
index ace5266cec9..daa3d329d10 100644

hw/arm/aspeed_eeprom.c line 7

Quoted 4 lines
hw/arm/aspeed_eeprom.c +1 -0
@@ -4,6 +4,7 @@
  * SPDX-License-Identifier: GPL-2.0-only
  */
 
+#include "qemu/osdep.h"

Just a question, as the code style, should we add a blank line after this header?

Quoted 6 lines
hw/arm/aspeed_eeprom.c +0 -0
 #include "aspeed_eeprom.h"
 
 /* Tiogapass BMC FRU */
Signature · 1 line
2.34.1
#13 lore raw

Re: [PATCH 04/10] aspeed: Clean up includes

Quoted 58 lines · Zhao Liu
Quoted 56 lines · Peter Maydell

Date: Thu, 25 Jan 2024 16:34:02 +0000
From: Peter Maydell <[email protected]>
Subject: [PATCH 04/10] aspeed: Clean up includes
X-Mailer: git-send-email 2.34.1

This commit was created with scripts/clean-includes.

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

---
 hw/arm/aspeed_eeprom.h     | 1 -
 tests/qtest/qtest_aspeed.h | 2 --
 hw/arm/aspeed_eeprom.c     | 1 +
 3 files changed, 1 insertion(+), 3 deletions(-)
hw/arm/aspeed_eeprom.h +0 -1
index bbf9e54365b..f08c16ef506 100644
@@ -7,7 +7,6 @@
 #ifndef ASPEED_EEPROM_H
 #define ASPEED_EEPROM_H
 
-#include "qemu/osdep.h"
 
 extern const uint8_t tiogapass_bmc_fruid[];
 extern const size_t tiogapass_bmc_fruid_len;
tests/qtest/qtest_aspeed.h +0 -2
index 235dfaa186a..d35b0c7cba5 100644
@@ -12,8 +12,6 @@
 #ifndef QTEST_ASPEED_H
 #define QTEST_ASPEED_H
 
-#include <stdint.h>
-
 #include "libqtest.h"
 
 #define AST2600_ASPEED_I2C_BASE_ADDR 0x1e78a000
hw/arm/aspeed_eeprom.c +0 -0
index ace5266cec9..daa3d329d10 100644
@@ -4,6 +4,7 @@
  * SPDX-License-Identifier: GPL-2.0-only
  */
 
Quoted 4 lines

hw/arm/aspeed_eeprom.c line 7

Quoted 1 line
hw/arm/aspeed_eeprom.c +1 -0
+#include "qemu/osdep.h"

Just a question, as the code style, should we add a blank line after this header?

No, we don't generally include blank lines in the #include block. (But all these patches are autogenerated, so you get what the script generates :-))

thanks
-- PMM

Reviewed-by on v1 4/10
#14 lore raw

Re: [PATCH 04/10] aspeed: Clean up includes

In reply to Peter Maydell
Quoted 11 lines · Peter Maydell

This commit was created with scripts/clean-includes.

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

Quoted 6 lines
---
  hw/arm/aspeed_eeprom.h     | 1 -
  tests/qtest/qtest_aspeed.h | 2 --
  hw/arm/aspeed_eeprom.c     | 1 +
  3 files changed, 1 insertion(+), 3 deletions(-)

r~

#15 lore raw

PATCH 5/10 acpi: Clean up includes

In reply to Peter Maydell

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git acpi include/hw/*/*acpi.h hw/*/*acpi.c

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

---
 include/hw/nvram/fw_cfg_acpi.h  | 1 -
 include/hw/virtio/virtio-acpi.h | 1 -
 hw/nvram/fw_cfg-acpi.c          | 1 +
 hw/virtio/virtio-acpi.c         | 1 +
 4 files changed, 2 insertions(+), 2 deletions(-)
include/hw/nvram/fw_cfg_acpi.h +0 -1
index b6553d86fcb..b39eb0490ff 100644
@@ -7,7 +7,6 @@
 #ifndef FW_CFG_ACPI_H
 #define FW_CFG_ACPI_H
 
-#include "qemu/osdep.h"
 #include "exec/hwaddr.h"
 
 void fw_cfg_acpi_dsdt_add(Aml *scope, const MemMapEntry *fw_cfg_memmap);
include/hw/virtio/virtio-acpi.h +0 -1
index 844e102569e..cace2a315f4 100644
@@ -6,7 +6,6 @@
 #ifndef VIRTIO_ACPI_H
 #define VIRTIO_ACPI_H
 
-#include "qemu/osdep.h"
 #include "exec/hwaddr.h"
 
 void virtio_acpi_dsdt_add(Aml *scope, const hwaddr virtio_mmio_base,
hw/nvram/fw_cfg-acpi.c +1 -0
index 4e48baeaa01..58cdcd3121c 100644
@@ -4,6 +4,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "hw/nvram/fw_cfg_acpi.h"
 #include "hw/acpi/aml-build.h"
 
hw/virtio/virtio-acpi.c +1 -0
index e18cb38bdbe..230a6695001 100644
@@ -4,6 +4,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "hw/virtio/virtio-acpi.h"
 #include "hw/acpi/aml-build.h"
 
Signature · 1 line
2.34.1
Reviewed-by on v1 5/10
#16 lore raw

Re: [PATCH 05/10] acpi: Clean up includes

Quoted 12 lines · Peter Maydell

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git acpi include/hw/*/*acpi.h hw/*/*acpi.c

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

Quoted 7 lines
---
  include/hw/nvram/fw_cfg_acpi.h  | 1 -
  include/hw/virtio/virtio-acpi.h | 1 -
  hw/nvram/fw_cfg-acpi.c          | 1 +
  hw/virtio/virtio-acpi.c         | 1 +
  4 files changed, 2 insertions(+), 2 deletions(-)
Reviewed-by on v1 5/10
#17 lore raw

Re: [PATCH 05/10] acpi: Clean up includes

In reply to Peter Maydell
Quoted 17 lines · Peter Maydell

Date: Thu, 25 Jan 2024 16:34:03 +0000
From: Peter Maydell <[email protected]>
Subject: [PATCH 05/10] acpi: Clean up includes
X-Mailer: git-send-email 2.34.1

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git acpi include/hw/*/*acpi.h hw/*/*acpi.c

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

Quoted 7 lines
---
 include/hw/nvram/fw_cfg_acpi.h  | 1 -
 include/hw/virtio/virtio-acpi.h | 1 -
 hw/nvram/fw_cfg-acpi.c          | 1 +
 hw/virtio/virtio-acpi.c         | 1 +
 4 files changed, 2 insertions(+), 2 deletions(-)
Quoted 53 lines
include/hw/nvram/fw_cfg_acpi.h +0 -1
index b6553d86fcb..b39eb0490ff 100644
@@ -7,7 +7,6 @@
 #ifndef FW_CFG_ACPI_H
 #define FW_CFG_ACPI_H
 
-#include "qemu/osdep.h"
 #include "exec/hwaddr.h"
 
 void fw_cfg_acpi_dsdt_add(Aml *scope, const MemMapEntry *fw_cfg_memmap);
include/hw/virtio/virtio-acpi.h +0 -1
index 844e102569e..cace2a315f4 100644
@@ -6,7 +6,6 @@
 #ifndef VIRTIO_ACPI_H
 #define VIRTIO_ACPI_H
 
-#include "qemu/osdep.h"
 #include "exec/hwaddr.h"
 
 void virtio_acpi_dsdt_add(Aml *scope, const hwaddr virtio_mmio_base,
hw/nvram/fw_cfg-acpi.c +1 -0
index 4e48baeaa01..58cdcd3121c 100644
@@ -4,6 +4,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "hw/nvram/fw_cfg_acpi.h"
 #include "hw/acpi/aml-build.h"
 
hw/virtio/virtio-acpi.c +1 -0
index e18cb38bdbe..230a6695001 100644
@@ -4,6 +4,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "hw/virtio/virtio-acpi.h"
 #include "hw/acpi/aml-build.h"
 
Signature · 1 line
2.34.1
Reviewed-by on v1 5/10
#18 lore raw

Re: [PATCH 05/10] acpi: Clean up includes

In reply to Peter Maydell
Quoted 12 lines · Peter Maydell

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git acpi include/hw/*/*acpi.h hw/*/*acpi.c

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

Quoted 7 lines
---
  include/hw/nvram/fw_cfg_acpi.h  | 1 -
  include/hw/virtio/virtio-acpi.h | 1 -
  hw/nvram/fw_cfg-acpi.c          | 1 +
  hw/virtio/virtio-acpi.c         | 1 +
  4 files changed, 2 insertions(+), 2 deletions(-)

r~

#19 lore raw

PATCH 6/10 m68k: Clean up includes

In reply to Peter Maydell

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git m68k include/hw/audio/asc.h include/hw/m68k/*.h

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

---
 include/hw/audio/asc.h      | 1 -
 include/hw/m68k/q800-glue.h | 1 -
 2 files changed, 2 deletions(-)
include/hw/audio/asc.h +0 -1
index 4741f92c461..04fac270b6a 100644
@@ -13,7 +13,6 @@
 #ifndef HW_AUDIO_ASC_H
 #define HW_AUDIO_ASC_H
 
-#include "qemu/osdep.h"
 #include "hw/sysbus.h"
 #include "audio/audio.h"
 
include/hw/m68k/q800-glue.h +0 -1
index ceb916d16c1..04fac25f6c2 100644
@@ -23,7 +23,6 @@
 #ifndef HW_Q800_GLUE_H
 #define HW_Q800_GLUE_H
 
-#include "qemu/osdep.h"
 #include "hw/sysbus.h"
 
 #define TYPE_GLUE "q800-glue"
Signature · 1 line
2.34.1
Reviewed-by on v1 6/10
#20 lore raw

Re: [PATCH 06/10] m68k: Clean up includes

Quoted 12 lines · Peter Maydell

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git m68k include/hw/audio/asc.h include/hw/m68k/*.h

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

Quoted 5 lines
---
  include/hw/audio/asc.h      | 1 -
  include/hw/m68k/q800-glue.h | 1 -
  2 files changed, 2 deletions(-)
Reviewed-by on v1 6/10
#21 lore raw

Re: [PATCH 06/10] m68k: Clean up includes

In reply to Peter Maydell
Quoted 17 lines · Peter Maydell

Date: Thu, 25 Jan 2024 16:34:04 +0000
From: Peter Maydell <[email protected]>
Subject: [PATCH 06/10] m68k: Clean up includes
X-Mailer: git-send-email 2.34.1

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git m68k include/hw/audio/asc.h include/hw/m68k/*.h

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

Quoted 5 lines
---
 include/hw/audio/asc.h      | 1 -
 include/hw/m68k/q800-glue.h | 1 -
 2 files changed, 2 deletions(-)
Quoted 29 lines
include/hw/audio/asc.h +0 -1
index 4741f92c461..04fac270b6a 100644
@@ -13,7 +13,6 @@
 #ifndef HW_AUDIO_ASC_H
 #define HW_AUDIO_ASC_H
 
-#include "qemu/osdep.h"
 #include "hw/sysbus.h"
 #include "audio/audio.h"
 
include/hw/m68k/q800-glue.h +0 -1
index ceb916d16c1..04fac25f6c2 100644
@@ -23,7 +23,6 @@
 #ifndef HW_Q800_GLUE_H
 #define HW_Q800_GLUE_H
 
-#include "qemu/osdep.h"
 #include "hw/sysbus.h"
 
 #define TYPE_GLUE "q800-glue"
Signature · 1 line
2.34.1
Reviewed-by on v1 6/10
#22 lore raw

Re: [PATCH 06/10] m68k: Clean up includes

In reply to Peter Maydell
Quoted 35 lines · Peter Maydell

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git m68k include/hw/audio/asc.h include/hw/m68k/*.h

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

---
  include/hw/audio/asc.h      | 1 -
  include/hw/m68k/q800-glue.h | 1 -
  2 files changed, 2 deletions(-)
include/hw/audio/asc.h +0 -1
index 4741f92c461..04fac270b6a 100644
@@ -13,7 +13,6 @@
  #ifndef HW_AUDIO_ASC_H
  #define HW_AUDIO_ASC_H
 
-#include "qemu/osdep.h"
  #include "hw/sysbus.h"
  #include "audio/audio.h"
 
include/hw/m68k/q800-glue.h +0 -0
index ceb916d16c1..04fac25f6c2 100644

include/hw/m68k/q800-glue.h line 28

Quoted 7 lines
include/hw/m68k/q800-glue.h +0 -1
@@ -23,7 +23,6 @@
  #ifndef HW_Q800_GLUE_H
  #define HW_Q800_GLUE_H
 
-#include "qemu/osdep.h"
  #include "hw/sysbus.h"
 
  #define TYPE_GLUE "q800-glue"
#23 lore raw

PATCH 7/10 include: Clean up includes

In reply to Peter Maydell

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git include include/*/*.h include/*/*/*.h

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

---
I hand-checked that all these headers are included only by .c files which already have osdep.h included.

---
 include/hw/arm/raspberrypi-fw-defs.h | 1 -
 include/hw/mem/memory-device.h       | 1 -
 include/hw/ppc/spapr_nested.h        | 1 -
 include/hw/xen/xen-hvm-common.h      | 1 -
 include/qemu/qtree.h                 | 1 -
 include/ui/rect.h                    | 2 --
 6 files changed, 7 deletions(-)
include/hw/arm/raspberrypi-fw-defs.h +0 -1
index 4551fe7450d..579cf0d5546 100644
@@ -10,7 +10,6 @@
 #ifndef INCLUDE_HW_MISC_RASPBERRYPI_FW_DEFS_H_
 #define INCLUDE_HW_MISC_RASPBERRYPI_FW_DEFS_H_
 
-#include "qemu/osdep.h"
 
 enum rpi_firmware_property_tag {
     RPI_FWREQ_PROPERTY_END =                           0,
include/hw/mem/memory-device.h +0 -1
index a1d62cc551a..e0571c8a319 100644
@@ -14,7 +14,6 @@
 #define MEMORY_DEVICE_H
 
 #include "hw/qdev-core.h"
-#include "qemu/typedefs.h"
 #include "qapi/qapi-types-machine.h"
 #include "qom/object.h"
 
include/hw/ppc/spapr_nested.h +0 -1
index d3834864764..d312a5d61da 100644
@@ -1,7 +1,6 @@
 #ifndef HW_SPAPR_NESTED_H
 #define HW_SPAPR_NESTED_H
 
-#include "qemu/osdep.h"
 #include "target/ppc/cpu.h"
 
 /*
include/hw/xen/xen-hvm-common.h +0 -1
index 4e9904f1a65..4b1d728f35c 100644
@@ -1,7 +1,6 @@
 #ifndef HW_XEN_HVM_COMMON_H
 #define HW_XEN_HVM_COMMON_H
 
-#include "qemu/osdep.h"
 #include "qemu/units.h"
 
 #include "cpu.h"
include/qemu/qtree.h +0 -1
index 69fe74b50d0..dc2b14d2582 100644
@@ -42,7 +42,6 @@
 #ifndef QEMU_QTREE_H
 #define QEMU_QTREE_H
 
-#include "qemu/osdep.h"
 
 #ifdef HAVE_GLIB_WITH_SLICE_ALLOCATOR
 
include/ui/rect.h +0 -2
index 68f05d78a8e..7ebf47ebcdc 100644
@@ -4,8 +4,6 @@
 #ifndef QEMU_RECT_H
 #define QEMU_RECT_H
 
-#include <stdint.h>
-#include <stdbool.h>
 
 typedef struct QemuRect {
     int16_t x;
Signature · 1 line
2.34.1
Reviewed-by on v1 7/10
#24 lore raw

Re: [PATCH 07/10] include: Clean up includes

Quoted 21 lines · Peter Maydell

Date: Thu, 25 Jan 2024 16:34:05 +0000
From: Peter Maydell <[email protected]>
Subject: [PATCH 07/10] include: Clean up includes
X-Mailer: git-send-email 2.34.1

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git include include/*/*.h include/*/*/*.h

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

---
I hand-checked that all these headers are included only by .c files which already have osdep.h included.

Quoted 8 lines
---
 include/hw/arm/raspberrypi-fw-defs.h | 1 -
 include/hw/mem/memory-device.h       | 1 -
 include/hw/ppc/spapr_nested.h        | 1 -
 include/hw/xen/xen-hvm-common.h      | 1 -
 include/qemu/qtree.h                 | 1 -
 include/ui/rect.h                    | 2 --
 6 files changed, 7 deletions(-)
Quoted 78 lines
include/hw/arm/raspberrypi-fw-defs.h +0 -1
index 4551fe7450d..579cf0d5546 100644
@@ -10,7 +10,6 @@
 #ifndef INCLUDE_HW_MISC_RASPBERRYPI_FW_DEFS_H_
 #define INCLUDE_HW_MISC_RASPBERRYPI_FW_DEFS_H_
 
-#include "qemu/osdep.h"
 
 enum rpi_firmware_property_tag {
     RPI_FWREQ_PROPERTY_END =                           0,
include/hw/mem/memory-device.h +0 -1
index a1d62cc551a..e0571c8a319 100644
@@ -14,7 +14,6 @@
 #define MEMORY_DEVICE_H
 
 #include "hw/qdev-core.h"
-#include "qemu/typedefs.h"
 #include "qapi/qapi-types-machine.h"
 #include "qom/object.h"
 
include/hw/ppc/spapr_nested.h +0 -1
index d3834864764..d312a5d61da 100644
@@ -1,7 +1,6 @@
 #ifndef HW_SPAPR_NESTED_H
 #define HW_SPAPR_NESTED_H
 
-#include "qemu/osdep.h"
 #include "target/ppc/cpu.h"
 
 /*
include/hw/xen/xen-hvm-common.h +0 -1
index 4e9904f1a65..4b1d728f35c 100644
@@ -1,7 +1,6 @@
 #ifndef HW_XEN_HVM_COMMON_H
 #define HW_XEN_HVM_COMMON_H
 
-#include "qemu/osdep.h"
 #include "qemu/units.h"
 
 #include "cpu.h"
include/qemu/qtree.h +0 -1
index 69fe74b50d0..dc2b14d2582 100644
@@ -42,7 +42,6 @@
 #ifndef QEMU_QTREE_H
 #define QEMU_QTREE_H
 
-#include "qemu/osdep.h"
 
 #ifdef HAVE_GLIB_WITH_SLICE_ALLOCATOR
 
include/ui/rect.h +0 -2
index 68f05d78a8e..7ebf47ebcdc 100644
@@ -4,8 +4,6 @@
 #ifndef QEMU_RECT_H
 #define QEMU_RECT_H
 
-#include <stdint.h>
-#include <stdbool.h>
 
 typedef struct QemuRect {
     int16_t x;
Signature · 1 line
2.34.1
#25 lore raw

PATCH 8/10 cxl: Clean up includes

In reply to Peter Maydell

This commit was created with scripts/clean-includes.

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

---
 hw/cxl/cxl-events.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
hw/cxl/cxl-events.c +1 -3
index bee6dfaf148..affcf8a34dd 100644
@@ -7,11 +7,9 @@
  * COPYING file in the top-level directory.
  */
 
-#include <stdint.h>
-
 #include "qemu/osdep.h"
+
 #include "qemu/bswap.h"
-#include "qemu/typedefs.h"
 #include "qemu/error-report.h"
 #include "hw/pci/msi.h"
 #include "hw/pci/msix.h"
Signature · 1 line
2.34.1
Reviewed-by on v1 8/10
#26 lore raw

Re: [PATCH 08/10] cxl: Clean up includes

Quoted 11 lines · Peter Maydell

This commit was created with scripts/clean-includes.

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

Quoted 4 lines
---
  hw/cxl/cxl-events.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
Reviewed-by on v1 8/10
#27 lore raw

Re: [PATCH 08/10] cxl: Clean up includes

In reply to Peter Maydell
Quoted 16 lines · Peter Maydell

Date: Thu, 25 Jan 2024 16:34:06 +0000
From: Peter Maydell <[email protected]>
Subject: [PATCH 08/10] cxl: Clean up includes
X-Mailer: git-send-email 2.34.1

This commit was created with scripts/clean-includes.

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

Quoted 4 lines
---
 hw/cxl/cxl-events.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
Quoted 22 lines
hw/cxl/cxl-events.c +1 -3
index bee6dfaf148..affcf8a34dd 100644
@@ -7,11 +7,9 @@
  * COPYING file in the top-level directory.
  */
 
-#include <stdint.h>
-
 #include "qemu/osdep.h"
+
 #include "qemu/bswap.h"
-#include "qemu/typedefs.h"
 #include "qemu/error-report.h"
 #include "hw/pci/msi.h"
 #include "hw/pci/msix.h"
Signature · 1 line
2.34.1
Acked-by Jonathan Cameron on v1 8/10
#28 lore raw

Re: [PATCH 08/10] cxl: Clean up includes

In reply to Peter Maydell
Quoted 5 lines · On Thu, 25 Jan 2024 16:34:06 +0000 Peter Maydell <[email protected]>…

This commit was created with scripts/clean-includes.

All .c should include qemu/osdep.h first. The script performs three related cleanups:

Quoted 7 lines

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

Quoted 21 lines
---
 hw/cxl/cxl-events.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
hw/cxl/cxl-events.c +1 -3
index bee6dfaf148..affcf8a34dd 100644
@@ -7,11 +7,9 @@
  * COPYING file in the top-level directory.
  */
 
-#include <stdint.h>
-
 #include "qemu/osdep.h"
+
 #include "qemu/bswap.h"
-#include "qemu/typedefs.h"
 #include "qemu/error-report.h"
 #include "hw/pci/msi.h"
 #include "hw/pci/msix.h"
#29 lore raw

PATCH 9/10 riscv: Clean up includes

In reply to Peter Maydell

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git riscv target/riscv/*.[ch]

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

---
 target/riscv/vector_internals.h | 1 -
 target/riscv/vector_internals.c | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)
target/riscv/vector_internals.h +0 -1
index 8133111e5f6..842765f6c16 100644
@@ -19,7 +19,6 @@
 #ifndef TARGET_RISCV_VECTOR_INTERNALS_H
 #define TARGET_RISCV_VECTOR_INTERNALS_H
 
-#include "qemu/osdep.h"
 #include "qemu/bitops.h"
 #include "cpu.h"
 #include "tcg/tcg-gvec-desc.h"
target/riscv/vector_internals.c +1 -0
index 9cf5c17cdea..12f5964fbbe 100644
@@ -16,6 +16,7 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "vector_internals.h"
 
 /* set agnostic elements to 1s */
Signature · 1 line
2.34.1
Reviewed-by on v1 9/10
#30 lore raw

Re: [PATCH 09/10] riscv: Clean up includes

Quoted 12 lines · Peter Maydell

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git riscv target/riscv/*.[ch]

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

Quoted 5 lines
---
  target/riscv/vector_internals.h | 1 -
  target/riscv/vector_internals.c | 1 +
  2 files changed, 1 insertion(+), 1 deletion(-)
Reviewed-by on v1 9/10
#31 lore raw

Re: [PATCH 09/10] riscv: Clean up includes

In reply to Peter Maydell
Quoted 17 lines · Peter Maydell

Date: Thu, 25 Jan 2024 16:34:07 +0000
From: Peter Maydell <[email protected]>
Subject: [PATCH 09/10] riscv: Clean up includes
X-Mailer: git-send-email 2.34.1

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git riscv target/riscv/*.[ch]

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

Quoted 5 lines
---
 target/riscv/vector_internals.h | 1 -
 target/riscv/vector_internals.c | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)
Quoted 29 lines
target/riscv/vector_internals.h +0 -1
index 8133111e5f6..842765f6c16 100644
@@ -19,7 +19,6 @@
 #ifndef TARGET_RISCV_VECTOR_INTERNALS_H
 #define TARGET_RISCV_VECTOR_INTERNALS_H
 
-#include "qemu/osdep.h"
 #include "qemu/bitops.h"
 #include "cpu.h"
 #include "tcg/tcg-gvec-desc.h"
target/riscv/vector_internals.c +1 -0
index 9cf5c17cdea..12f5964fbbe 100644
@@ -16,6 +16,7 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "vector_internals.h"
 
 /* set agnostic elements to 1s */
Signature · 1 line
2.34.1
Reviewed-by on v1 9/10
#32 lore raw

Re: [PATCH 09/10] riscv: Clean up includes

In reply to Peter Maydell
Quoted 7 lines · Peter Maydell

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git riscv target/riscv/*.[ch]

All .c should include qemu/osdep.h first. The script performs three related cleanups:

Quoted 7 lines

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

Alistair

Quoted 33 lines
---
 target/riscv/vector_internals.h | 1 -
 target/riscv/vector_internals.c | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)
target/riscv/vector_internals.h +0 -1
index 8133111e5f6..842765f6c16 100644
@@ -19,7 +19,6 @@
 #ifndef TARGET_RISCV_VECTOR_INTERNALS_H
 #define TARGET_RISCV_VECTOR_INTERNALS_H
 
-#include "qemu/osdep.h"
 #include "qemu/bitops.h"
 #include "cpu.h"
 #include "tcg/tcg-gvec-desc.h"
target/riscv/vector_internals.c +1 -1
index 9cf5c17cdea..12f5964fbbe 100644
@@ -16,6 +16,7 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "vector_internals.h"
 
 /* set agnostic elements to 1s */
--

2.34.1

#33 lore raw

PATCH 10/10 misc: Clean up includes

In reply to Peter Maydell

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git misc net/af-xdp.c plugins/*.c audio/pwaudio.c util/userfaultfd.c

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

---
These are all cases where files include things osdep already gives them.

---
 audio/pwaudio.c    | 1 -
 net/af-xdp.c       | 1 -
 plugins/core.c     | 1 -
 plugins/loader.c   | 1 -
 util/userfaultfd.c | 1 -
 5 files changed, 5 deletions(-)
audio/pwaudio.c +0 -1
index 3ce5f6507b4..3b14e04fbb0 100644
@@ -11,7 +11,6 @@
 #include "qemu/osdep.h"
 #include "qemu/module.h"
 #include "audio.h"
-#include <errno.h>
 #include "qemu/error-report.h"
 #include "qapi/error.h"
 #include <spa/param/audio/format-utils.h>
net/af-xdp.c +0 -1
index 6c65028fb00..38e600703a3 100644
@@ -13,7 +13,6 @@
 
 #include "qemu/osdep.h"
 #include <bpf/bpf.h>
-#include <inttypes.h>
 #include <linux/if_link.h>
 #include <linux/if_xdp.h>
 #include <net/if.h>
plugins/core.c +0 -1
index 49588285dd0..ee2fa41af9e 100644
@@ -27,7 +27,6 @@
 #include "tcg/tcg.h"
 #include "tcg/tcg-op.h"
 #include "plugin.h"
-#include "qemu/compiler.h"
 
 struct qemu_plugin_cb {
     struct qemu_plugin_ctx *ctx;
plugins/loader.c +0 -1
index 734c11cae04..9768b78eb6b 100644
@@ -33,7 +33,6 @@
 #ifndef CONFIG_USER_ONLY
 #include "hw/boards.h"
 #endif
-#include "qemu/compiler.h"
 
 #include "plugin.h"
 
util/userfaultfd.c +0 -1
index fdff4867e8b..1b2fa949d4d 100644
@@ -18,7 +18,6 @@
 #include <poll.h>
 #include <sys/syscall.h>
 #include <sys/ioctl.h>
-#include <fcntl.h>
 
 typedef enum {
     UFFD_UNINITIALIZED = 0,
Signature · 1 line
2.34.1
Reviewed-by on v1 10/10
#34 lore raw

Re: [PATCH 10/10] misc: Clean up includes

Quoted 20 lines · Peter Maydell

Date: Thu, 25 Jan 2024 16:34:08 +0000
From: Peter Maydell <[email protected]>
Subject: [PATCH 10/10] misc: Clean up includes
X-Mailer: git-send-email 2.34.1

This commit was created with scripts/clean-includes:
./scripts/clean-includes --git misc net/af-xdp.c plugins/*.c audio/pwaudio.c util/userfaultfd.c

All .c should include qemu/osdep.h first. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

---
These are all cases where files include things osdep already gives them.

Quoted 7 lines
---
 audio/pwaudio.c    | 1 -
 net/af-xdp.c       | 1 -
 plugins/core.c     | 1 -
 plugins/loader.c   | 1 -
 util/userfaultfd.c | 1 -
 5 files changed, 5 deletions(-)
Quoted 65 lines
audio/pwaudio.c +0 -1
index 3ce5f6507b4..3b14e04fbb0 100644
@@ -11,7 +11,6 @@
 #include "qemu/osdep.h"
 #include "qemu/module.h"
 #include "audio.h"
-#include <errno.h>
 #include "qemu/error-report.h"
 #include "qapi/error.h"
 #include <spa/param/audio/format-utils.h>
net/af-xdp.c +0 -1
index 6c65028fb00..38e600703a3 100644
@@ -13,7 +13,6 @@
 
 #include "qemu/osdep.h"
 #include <bpf/bpf.h>
-#include <inttypes.h>
 #include <linux/if_link.h>
 #include <linux/if_xdp.h>
 #include <net/if.h>
plugins/core.c +0 -1
index 49588285dd0..ee2fa41af9e 100644
@@ -27,7 +27,6 @@
 #include "tcg/tcg.h"
 #include "tcg/tcg-op.h"
 #include "plugin.h"
-#include "qemu/compiler.h"
 
 struct qemu_plugin_cb {
     struct qemu_plugin_ctx *ctx;
plugins/loader.c +0 -1
index 734c11cae04..9768b78eb6b 100644
@@ -33,7 +33,6 @@
 #ifndef CONFIG_USER_ONLY
 #include "hw/boards.h"
 #endif
-#include "qemu/compiler.h"
 
 #include "plugin.h"
 
util/userfaultfd.c +0 -1
index fdff4867e8b..1b2fa949d4d 100644
@@ -18,7 +18,6 @@
 #include <poll.h>
 #include <sys/syscall.h>
 #include <sys/ioctl.h>
-#include <fcntl.h>
 
 typedef enum {
     UFFD_UNINITIALIZED = 0,
Signature · 1 line
2.34.1
#35 lore raw
In reply to Peter Maydell

25.01.2024 19:33, Peter Maydell :

Quoted 25 lines

This series makes a bunch of automated edits with the clean-includes script. The script performs three related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c already includes it. Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant. Drop these, too.

I created the series by looking at a run of the script across the whole tree (./scripts/clean-includes --git includes --all) produces, and then disentangling that into (a) different cohesive parts and (b) files that needed to go into the script's exclude-list.

After this series, the tree is still not entirely clean -- there are 20 other files the script wants to change. But at least some of them are things that should be on the exclude list, and some are things which I didn't feel like taking the time to try to decide whether they should be fixed or excluded. I might come back to these at some later date, but I figured this series was enough to be going on with.

thanks
-- PMM

Quoted 11 lines

Peter Maydell (10):
scripts/clean-includes: Update exclude list
hyperv: Clean up includes
disas/riscv: Clean up includes
aspeed: Clean up includes
acpi: Clean up includes
m68k: Clean up includes
include: Clean up includes
cxl: Clean up includes
riscv: Clean up includes
misc: Clean up includes

Applied to trivial-patches tree, thanks!

/mjt