I realised that we haven't run clean-includes recently, and unsurprisingly various violations of our include policy have crept in to the tree. The exclude-list of files it shouldn't be run on has also grown rather out of date.
While looking at this I realised that one reason the exclude list is stale is that it's encoded in the script in a really awkward single long line extended regex. So the main thing this patch series does is fix that to instead use a list of regexes, one per line, with comments permitted. The other useful new feature here is that you can now point the script at a directory (previously your only options were an explicit list of files, or '--all' to scan everything). The other changes to the script itself are minor cleanups. Finally, I have a couple of patches which are the result of running the script on some subdirectories. I do think that all the changes that the script now suggests are correct (it wants to make changes to 28 files other than these) but I wanted to get the script changes through review first, and then perhaps send those last changes a bit more broken up per-subsystem. thanks -- PMM Peter Maydell (9): scripts/clean-includes: Allow directories on command line scripts/clean-includes: Remove outdated comment scripts/clean-includes: Make ignore-regexes one per line scripts/clean-includes: Do all our exclusions with REGEXFILE scripts/clean-includes: Give the args in git commit messages scripts/clean-includes: Update exclude list cxl: Clean up includes vfio: Clean up includes tests: Clean up includes hw/vfio-user/container.h | 1 - hw/vfio-user/device.h | 1 - hw/vfio/pci-quirks.h | 1 - tests/qtest/aspeed-hace-utils.h | 1 - tests/qtest/aspeed-smc-utils.h | 1 - hw/cxl/cxl-mailbox-utils.c | 2 +- hw/mem/cxl_type3.c | 2 +- hw/vfio-user/container.c | 2 +- hw/vfio-user/pci.c | 2 +- hw/vfio/ap.c | 1 - hw/vfio/container.c | 2 +- hw/vfio/cpr-legacy.c | 2 +- tests/qtest/aspeed_gpio-test.c | 1 - tests/qtest/dbus-display-test.c | 3 - tests/qtest/pnv-spi-seeprom-test.c | 1 - tests/unit/test-cutils.c | 2 +- tests/unit/test-error-report.c | 1 - tests/unit/test-io-channel-command.c | 2 - scripts/clean-includes | 88 ++++++++++++++++++---------- 19 files changed, 63 insertions(+), 53 deletions(-) -- 2.43.0
