[PATCH 00/10] Clean up includes

Peter Maydell posted 10 patches 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240125163408.1595135-1-peter.maydell@linaro.org
Maintainers: Gerd Hoffmann <kraxel@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Christoph Muellner <christoph.muellner@vrull.eu>, LIU Zhiwei <zhiwei_liu@linux.alibaba.com>, Philipp Tomsich <philipp.tomsich@vrull.eu>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <Alistair.Francis@wdc.com>, "Cédric Le Goater" <clg@kaod.org>, Peter Maydell <peter.maydell@linaro.org>, Andrew Jeffery <andrew@codeconstruct.com.au>, Joel Stanley <joel@jms.id.au>, Jonathan Cameron <jonathan.cameron@huawei.com>, Fan Ni <fan.ni@samsung.com>, "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, "Michael S. Tsirkin" <mst@redhat.com>, Laurent Vivier <laurent@vivier.eu>, David Hildenbrand <david@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Xiao Guangrong <xiaoguangrong.eric@gmail.com>, Nicholas Piggin <npiggin@gmail.com>, Daniel Henrique Barboza <danielhb413@gmail.com>, David Gibson <david@gibson.dropbear.id.au>, Harsh Prateek Bora <harshpb@linux.ibm.com>, Stefano Stabellini <sstabellini@kernel.org>, Anthony Perard <anthony.perard@citrix.com>, Paul Durrant <paul@xen.org>, Ilya Maximets <i.maximets@ovn.org>, Jason Wang <jasowang@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Alexandre Iooss <erdnaxe@crans.org>, Mahmoud Mandour <ma.mandourr@gmail.com>, Bin Meng <bin.meng@windriver.com>, Weiwei Li <liwei1518@gmail.com>, Thomas Huth <thuth@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>
There is a newer version of this series
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(-)
[PATCH 00/10] Clean up includes
Posted by Peter Maydell 10 months ago
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(-)

-- 
2.34.1
Re: [PATCH 00/10] Clean up includes
Posted by Michael Tokarev 10 months ago
25.01.2024 19:33, Peter Maydell :
> 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

Applied to trivial-patches tree, thanks!

/mjt