Clean up includes
Subsystems (8)
v4 cover Clean up includes
Back in 2016, we discussed[1] rules for headers, and these were generally liked:
1. Have a carefully curated header that's included everywhere first. We got that already thanks to Peter: osdep.h.
2. Headers should normally include everything they need beyond osdep.h. If exceptions are needed for some reason, they must be documented in the header. If all that's needed from a header is typedefs, put those into qemu/typedefs.h instead of including the header.
3. Cyclic inclusion is forbidden.
This series fixes violations of rule 2. I may have split patches too aggressively. Let me know if you want some squashed together.
v4:
* PATCH 01-03: New
* PATCH 04-15: Previous version redone with scripts/clean-includes, result split up for review
* PATCH 16-19: New
v3:
* Rebased, old PATCH 1+2+4 are in master as commit 881e019770..f07ceffdf5
* PATCH 1: Fix bsd-user
v2:
* Rebased
* PATCH 3: v1 posted separately
* PATCH 4: New
[1] Message-ID: <[email protected]>
https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg03345.html
Markus Armbruster (19):
scripts/clean-includes: Fully skip / ignore files scripts/clean-includes: Don't claim duplicate headers found when not scripts/clean-includes: Skip symbolic links
bsd-user: Clean up includes
crypto: Clean up includes
hw/cxl: Clean up includes
hw/input: Clean up includes
hw/tricore: Clean up includes
qga: Clean up includes
migration: Clean up includes
net: Clean up includes
target/hexagon: Clean up includes
riscv: Clean up includes
block: Clean up includes
accel: Clean up includes
Fix non-first inclusions of qemu/osdep.h
Don't include headers already included by qemu/osdep.h 9p: Drop superfluous include of linux/limits.h
Drop duplicate #include
backends/tpm/tpm_ioctl.h | 2 -- bsd-user/bsd-proc.h | 4 ---- bsd-user/qemu.h | 1 - crypto/block-luks-priv.h | 1 - fsdev/p9array.h | 2 -- include/block/graph-lock.h | 1 - include/block/write-threshold.h | 2 -- include/hw/arm/fsl-imx6ul.h | 1 - include/hw/arm/fsl-imx7.h | 1 - include/hw/cxl/cxl_component.h | 2 -- include/hw/cxl/cxl_host.h | 1 - include/hw/cxl/cxl_pci.h | 1 - include/hw/input/pl050.h | 1 - include/hw/misc/aspeed_lpc.h | 2 -- include/hw/pci/pcie_doe.h | 1 - include/hw/tricore/triboard.h | 1 - include/qemu/async-teardown.h | 2 -- include/qemu/dbus.h | 1 - include/qemu/host-utils.h | 1 - include/qemu/userfaultfd.h | 1 - include/sysemu/accel-blocker.h | 1 - include/sysemu/event-loop-base.h | 1 - net/vmnet_int.h | 1 - qga/cutils.h | 2 -- target/hexagon/hex_arch_types.h | 1 - target/hexagon/mmvec/macros.h | 1 - target/riscv/pmu.h | 1 - accel/tcg/cpu-exec.c | 1 - audio/sndioaudio.c | 2 +- backends/hostmem-epc.c | 2 +- backends/tpm/tpm_emulator.c | 1 - block/export/vduse-blk.c | 2 +- block/qapi.c | 1 - bsd-user/arm/signal.c | 1 + bsd-user/arm/target_arch_cpu.c | 2 ++ bsd-user/freebsd/os-sys.c | 1 + bsd-user/i386/signal.c | 1 + bsd-user/i386/target_arch_cpu.c | 3 +-- bsd-user/main.c | 4 +--- bsd-user/strace.c | 1 - bsd-user/x86_64/signal.c | 1 + bsd-user/x86_64/target_arch_cpu.c | 3 +-- hw/9pfs/9p.c | 5 ----- hw/acpi/piix4.c | 1 - hw/alpha/dp264.c | 1 - hw/arm/virt.c | 1 - hw/arm/xlnx-versal.c | 1 - hw/block/pflash_cfi01.c | 1 - hw/core/machine.c | 1 - hw/display/virtio-gpu-udmabuf.c | 1 - hw/hppa/machine.c | 1 - hw/hyperv/syndbg.c | 2 +- hw/i2c/pmbus_device.c | 1 - hw/i386/acpi-build.c | 1 - hw/input/tsc210x.c | 1 - hw/loongarch/acpi-build.c | 1 - hw/misc/macio/cuda.c | 1 - hw/misc/macio/pmu.c | 1 - hw/net/xilinx_axienet.c | 1 - hw/ppc/ppc405_uc.c | 2 -- hw/ppc/ppc440_bamboo.c | 1 - hw/ppc/spapr_drc.c | 1 - hw/rdma/vmw/pvrdma_dev_ring.c | 1 - hw/remote/machine.c | 1 - hw/remote/proxy-memory-listener.c | 1 - hw/remote/remote-obj.c | 1 - hw/rtc/mc146818rtc.c | 1 - hw/s390x/virtio-ccw-serial.c | 1 - hw/sensor/adm1272.c | 1 - hw/usb/dev-storage-bot.c | 1 - hw/usb/dev-storage-classic.c | 1 - migration/postcopy-ram.c | 2 -- qga/commands-posix.c | 1 - qga/cutils.c | 3 ++- softmmu/dirtylimit.c | 1 - softmmu/runstate.c | 1 - softmmu/vl.c | 3 --- target/loongarch/translate.c | 1 - target/mips/tcg/translate.c | 1 - target/nios2/translate.c | 2 -- tcg/tci.c | 1 - tests/unit/test-cutils.c | 1 - tests/unit/test-seccomp.c | 1 - ui/gtk.c | 1 - ui/udmabuf.c | 1 - util/async-teardown.c | 12 ++++-------- util/main-loop.c | 1 - util/oslib-posix.c | 6 ------ scripts/clean-includes | 15 ++++++++++----- 89 files changed, 29 insertions(+), 123 deletions(-)
Signature · 1 line
2.39.0
PATCH v4 1/19 scripts/clean-includes: Fully skip / ignore files
When clean-includes claims to skip or ignore a file, only the part that sanitizes use of qemu/osdep.h skips the file. The part that looks for duplicate #include does not, and neither does committing to Git.
The latter can get unrelated stuff included in the commit, but only if you run clean-includes in a dirty tree, which is unwise. Messed up when we added skipping in commit fd3e39a40c "scripts/clean-includes:
Enhance to handle header files".
The former can cause bogus reports for --check-dup-head. Added in commit d66253e46a "scripts/clean-includes: added duplicate #include check", duplicating the prior mistake.
Fix the script to fully skip files.
--- scripts/clean-includes | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
scripts/clean-includes +5 -3
@@ -111,6 +111,7 @@ cat >"$COCCIFILE" <<EOT ) EOT +files= for f in "$@"; do case "$f" in *.c.inc)
@@ -144,6 +145,7 @@ for f in "$@"; do continue ;; esac + files="$files $f" if [ "$MODE" = "c" ]; then # First, use Coccinelle to add qemu/osdep.h before the first existing include
@@ -174,8 +176,8 @@ for f in "$@"; do done -if [ "$DUPHEAD" = "yes" ]; then - egrep "^[[:space:]]*#[[:space:]]*include" "$@" | tr -d '[:blank:]' \ +if [ "$DUPHEAD" = "yes" ] && [ -n "$files" ]; then + egrep "^[[:space:]]*#[[:space:]]*include" $files | tr -d '[:blank:]' \ | sort | uniq -c | awk '{if ($1 > 1) print $0}' if [ $? -eq 0 ]; then echo "Found duplicate header file includes. Please check the above files manually."
@@ -184,7 +186,7 @@ if [ "$DUPHEAD" = "yes" ]; then fi if [ "$GIT" = "yes" ]; then - git add -- "$@" + git add -- $files git commit --signoff -F - <<EOF $GITSUBJ: Clean up includes
Signature · 1 line
2.39.0
Re: [PATCH v4 01/19] scripts/clean-includes: Fully skip / ignore files
On Thu, Jan 19, 2023 at 07:59:41AM +0100, Markus Armbruster wrote:
...
Quoted 23 lines
Fix the script to fully skip files.
Fixes fd3e39a40ca2ee26b09a5de3149af8b056b85233Fixes d66253e46ae2b9c36a9dd90b2b74c0dfa5804b22Signed-off-by Markus Armbruster <[email protected]>--- scripts/clean-includes | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)scripts/clean-includes +1
-0@@ -111,6 +111,7 @@ cat >"$COCCIFILE" <<EOT ) EOT +files= for f in "$@"; do case "$f" in *.c.inc)
scripts/clean-includes for f in "$@"; do · line 148
Quoted 4 lines
scripts/clean-includes +1
-0@@ -144,6 +145,7 @@ for f in "$@"; do continue ;; esac + files="$files $f"
Bash's += might perform faster here, but this is a #!/bin/sh script.
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
Re: [PATCH v4 01/19] scripts/clean-includes: Fully skip / ignore files
In reply to Markus ArmbrusterQuoted 10 lines · Markus Armbruster
When clean-includes claims to skip or ignore a file, only the part that sanitizes use of
qemu/osdep.hskips the file. The part that looks for duplicate #include does not, and neither does committing to Git.The latter can get unrelated stuff included in the commit, but only if you run clean-includes in a dirty tree, which is unwise. Messed up when we added skipping in commit
fd3e39a40c"scripts/clean-includes:
Enhance to handle header files".
Quoted 8 lines
The former can cause bogus reports for --check-dup-head. Added in commit
d66253e46a"scripts/clean-includes: added duplicate #include check", duplicating the prior mistake.Fix the script to fully skip files.
Fixes fd3e39a40ca2ee26b09a5de3149af8b056b85233Fixes d66253e46ae2b9c36a9dd90b2b74c0dfa5804b22
Isn't
Fixes: %h (\"%s\")
the accepted format for this?
Quoted 47 lines
Signed-off-by Markus Armbruster <[email protected]>--- scripts/clean-includes | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)scripts/clean-includes +5
-3@@ -111,6 +111,7 @@ cat >"$COCCIFILE" <<EOT ) EOT +files= for f in "$@"; do case "$f" in *.c.inc)@@ -144,6 +145,7 @@ for f in "$@"; do continue ;; esac + files="$files $f" if [ "$MODE" = "c" ]; then # First, use Coccinelle to add qemu/osdep.h before the first existing include@@ -174,8 +176,8 @@ for f in "$@"; do done -if [ "$DUPHEAD" = "yes" ]; then - egrep "^[[:space:]]*#[[:space:]]*include" "$@" | tr -d '[:blank:]' \ +if [ "$DUPHEAD" = "yes" ] && [ -n "$files" ]; then + egrep "^[[:space:]]*#[[:space:]]*include" $files | tr -d '[:blank:]' \ | sort | uniq -c | awk '{if ($1 > 1) print $0}' if [ $? -eq 0 ]; then echo "Found duplicate header file includes. Please check the above files manually."@@ -184,7 +186,7 @@ if [ "$DUPHEAD" = "yes" ]; then fi if [ "$GIT" = "yes" ]; then - git add -- "$@" + git add -- $files git commit --signoff -F - <<EOF $GITSUBJ: Clean up includesSignature · 1 line
2.39.0
Re: [PATCH v4 01/19] scripts/clean-includes: Fully skip / ignore files
Quoted 17 lines · Michael S. Tsirkin
Quoted 16 lines · Markus Armbruster
When clean-includes claims to skip or ignore a file, only the part that sanitizes use of
qemu/osdep.hskips the file. The part that looks for duplicate #include does not, and neither does committing to Git.The latter can get unrelated stuff included in the commit, but only if you run clean-includes in a dirty tree, which is unwise. Messed up when we added skipping in commit
fd3e39a40c"scripts/clean-includes:
Enhance to handle header files".The former can cause bogus reports for --check-dup-head. Added in commit
d66253e46a"scripts/clean-includes: added duplicate #include check", duplicating the prior mistake.Fix the script to fully skip files.
Quoted 7 lines
Quoted 2 lines
Fixes fd3e39a40ca2ee26b09a5de3149af8b056b85233Fixes d66253e46ae2b9c36a9dd90b2b74c0dfa5804b22Isn't
Fixes: %h (\"%s\")the accepted format for this?
It seems to be common these days. I'll adjust.
PATCH v4 2/19 scripts/clean-includes: Don't claim duplicate headers found when not
In reply to Markus ArmbrusterWhen running with --check-dup-head, the script always claims it "Found duplicate header file includes." Fix to do it only when it actually found some.
--- scripts/clean-includes | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
scripts/clean-includes +2 -3
@@ -177,9 +177,8 @@ for f in "$@"; do done if [ "$DUPHEAD" = "yes" ] && [ -n "$files" ]; then - egrep "^[[:space:]]*#[[:space:]]*include" $files | tr -d '[:blank:]' \ - | sort | uniq -c | awk '{if ($1 > 1) print $0}' - if [ $? -eq 0 ]; then + if egrep "^[[:space:]]*#[[:space:]]*include" $files | tr -d '[:blank:]' \ + | sort | uniq -c | grep -v '^ *1 '; then echo "Found duplicate header file includes. Please check the above files manually." exit 1 fi
Signature · 1 line
2.39.0
Re: [PATCH v4 02/19] scripts/clean-includes: Don't claim duplicate headers found when not
Quoted 15 lines · Markus Armbruster
When running with --check-dup-head, the script always claims it "Found duplicate header file includes." Fix to do it only when it actually found some.
Fixes d66253e46ae2b9c36a9dd90b2b74c0dfa5804b22Signed-off-by Markus Armbruster <[email protected]>--- scripts/clean-includes | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)scripts/clean-includes +0
-0
scripts/clean-includes for f in "$@"; do · line 181
Quoted 8 lines
scripts/clean-includes +2
-3@@ -177,9 +177,8 @@ for f in "$@"; do done if [ "$DUPHEAD" = "yes" ] && [ -n "$files" ]; then - egrep "^[[:space:]]*#[[:space:]]*include" $files | tr -d '[:blank:]' \ - | sort | uniq -c | awk '{if ($1 > 1) print $0}' - if [ $? -eq 0 ]; then + if egrep "^[[:space:]]*#[[:space:]]*include" $files | tr -d '[:blank:]' \ + | sort | uniq -c | grep -v '^ *1 '; then
Indeed - the awk script was succeeding even if it printed nothing, whereas the grep -v is a bit lighter-weight and has the intended semantics of exit status based on output.
Quoted 7 lines
scripts/clean-includes +0
-0echo "Found duplicate header file includes. Please check the above files manually." exit 1 fiSignature · 1 line
2.39.0
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
PATCH v4 3/19 scripts/clean-includes: Skip symbolic links
In reply to Markus ArmbrusterWhen a symbolic link points to a file that needs cleaning, the script replaces the link with a cleaned regular file. Not wanted; skip them.
We have a few symbolic links under subprojects/libvduse/ and subprojects/libvhost-user/.
--- scripts/clean-includes | 4 ++++ 1 file changed, 4 insertions(+)
scripts/clean-includes +4 -0
@@ -113,6 +113,10 @@ EOT files= for f in "$@"; do + if [ -L "$f" ]; then + echo "SKIPPING $f (symbolic link)" + continue + fi case "$f" in *.c.inc) # These aren't standalone C source files
Signature · 1 line
2.39.0
Re: [PATCH v4 03/19] scripts/clean-includes: Skip symbolic links
Quoted 16 lines · Markus Armbruster
When a symbolic link points to a file that needs cleaning, the script replaces the link with a cleaned regular file. Not wanted; skip them.
We have a few symbolic links under subprojects/libvduse/ and subprojects/libvhost-user/.
Signed-off-by Markus Armbruster <[email protected]>--- scripts/clean-includes | 4 ++++ 1 file changed, 4 insertions(+)scripts/clean-includes +0
-0
scripts/clean-includes EOT · line 116
Quoted 4 lines
scripts/clean-includes +1
-0@@ -113,6 +113,10 @@ EOT files= for f in "$@"; do + if [ -L "$f" ]; then
I don't see -L used with test very often, but POSIX requires it, so it is safe for our choice of /bin/sh.
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
Re: [PATCH v4 03/19] scripts/clean-includes: Skip symbolic links
Quoted 18 lines · Eric Blake
Quoted 17 lines · Markus Armbruster
When a symbolic link points to a file that needs cleaning, the script replaces the link with a cleaned regular file. Not wanted; skip them.
We have a few symbolic links under subprojects/libvduse/ and subprojects/libvhost-user/.
Signed-off-by Markus Armbruster <[email protected]>--- scripts/clean-includes | 4 ++++ 1 file changed, 4 insertions(+)scripts/clean-includes +0
-0@@ -113,6 +113,10 @@ EOT
Quoted 7 lines
scripts/clean-includes EOT · line 116
Quoted 3 lines
scripts/clean-includes +1
-0files= for f in "$@"; do + if [ -L "$f" ]; thenI don't see -L used with test very often, but POSIX requires it, so it is safe for our choice of
/bin/sh.
FYI: -L is in FreeBSD, NetBSD, OpenBSD, etc. It's been in all these trees since the mid 90s. It wasn't in 4.4BSD, but all these projects have imported the code from pdksh's test.
So in addition to POSIX, it's been widely implemented, at least in the BSD world, for over 20 years.
Warner
PATCH v4 4/19 bsd-user: Clean up includes
In reply to Markus ArmbrusterClean up includes so that osdep.h is included first and headers which it implies are not included manually.
This commit was created with scripts/clean-includes.
--- bsd-user/bsd-proc.h | 4 ---- bsd-user/qemu.h | 1 - bsd-user/arm/signal.c | 1 + bsd-user/arm/target_arch_cpu.c | 2 ++ bsd-user/freebsd/os-sys.c | 1 + bsd-user/i386/signal.c | 1 + bsd-user/i386/target_arch_cpu.c | 3 +-- bsd-user/main.c | 4 +--- bsd-user/strace.c | 1 - bsd-user/x86_64/signal.c | 1 + bsd-user/x86_64/target_arch_cpu.c | 3 +-- 11 files changed, 9 insertions(+), 13 deletions(-)
bsd-user/bsd-proc.h +0 -4
@@ -20,11 +20,7 @@#ifndef BSD_PROC_H_ #define BSD_PROC_H_ -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/time.h> #include <sys/resource.h> -#include <unistd.h> /* exit(2) */ static inline abi_long do_bsd_exit (void *cpu_env,abi_long arg1)
bsd-user/qemu.h +0 -1
@@ -17,7 +17,6 @@#ifndef QEMU_H #define QEMU_H -#include "qemu/osdep.h" #include "cpu.h" #include "qemu/units.h" #include "exec/cpu_ldst.h"
bsd-user/arm/signal.c +1 -0
@@ -17,6 +17,7 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ +#include "qemu/osdep.h" #include "qemu.h" /*
bsd-user/arm/target_arch_cpu.c +2 -0
@@ -16,6 +16,8 @@* You should have received a copy of the GNU General Public License * along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include "qemu/osdep.h" #include "target_arch.h" void target_cpu_set_tls (CPUARMState *env,target_ulong newtls)
bsd-user/freebsd/os-sys.c +1 -0
@@ -17,6 +17,7 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ +#include "qemu/osdep.h" #include "qemu.h" #include "target_arch_sysarch.h"
bsd-user/i386/signal.c +1 -0
@@ -17,6 +17,7 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ +#include "qemu/osdep.h" #include "qemu.h" /*
bsd-user/i386/target_arch_cpu.c +1 -2
@@ -17,9 +17,8 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ -#include <sys/types.h> -#include "qemu/osdep.h" +#include "cpu.h" #include "qemu.h" #include "qemu/timer.h"
bsd-user/main.c +1 -3
@@ -18,12 +18,10 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ -#include <sys/types.h> -#include <sys/time.h> +#include "qemu/osdep.h" #include <sys/resource.h> #include <sys/sysctl.h> -#include "qemu/osdep.h" #include "qemu/help-texts.h" #include "qemu/units.h" #include "qemu/accel.h"
bsd-user/strace.c +0 -1
@@ -20,7 +20,6 @@#include <sys/select.h> #include <sys/syscall.h> #include <sys/ioccom.h> -#include <ctype.h> #include "qemu.h"
bsd-user/x86_64/signal.c +1 -0
@@ -16,6 +16,7 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ +#include "qemu/osdep.h" #include "qemu.h" /*
bsd-user/x86_64/target_arch_cpu.c +1 -2
@@ -17,9 +17,8 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ -#include <sys/types.h> -#include "qemu/osdep.h" +#include "cpu.h" #include "qemu.h" #include "qemu/timer.h"
Signature · 1 line
2.39.0
Re: [PATCH v4 04/19] bsd-user: Clean up includes
Quoted 25 lines · Markus Armbruster
Clean up includes so that
osdep.his included first and headers which it implies are not included manually.This commit was created with
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>--- bsd-user/bsd-proc.h | 4 ---- bsd-user/qemu.h | 1 - bsd-user/arm/signal.c | 1 + bsd-user/arm/target_arch_cpu.c | 2 ++ bsd-user/freebsd/os-sys.c | 1 + bsd-user/i386/signal.c | 1 + bsd-user/i386/target_arch_cpu.c | 3 +-- bsd-user/main.c | 4 +--- bsd-user/strace.c | 1 - bsd-user/x86_64/signal.c | 1 + bsd-user/x86_64/target_arch_cpu.c | 3 +-- 11 files changed, 9 insertions(+), 13 deletions(-)bsd-user/bsd-proc.h +0
-0
bsd-user/bsd-proc.h line 24
Quoted 8 lines
bsd-user/bsd-proc.h +0
-3@@ -20,11 +20,7 @@#ifndef BSD_PROC_H_ #define BSD_PROC_H_ -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/time.h> #include <sys/resource.h>
Did you test this on FreeBSD 12? FreeBSD 13 has started to climb the hill where all includes are independent, but much of that hasn't been merged to 12 yet. sys/types.h, at least, is documented as a prereq for both sys/stat.h and sys/resource.h.
I know many of these are in os-dep.h, and I've had trouble in the bsd-user fork with that and the layout of the code which has arguably way too much in the .h files.
Also, why didn't you move sys/resource.h and other such files to os-dep.h? I'm struggling to understand the rules around what is or isn't included where?
Quoted 131 lines
bsd-user/bsd-proc.h +0
-1-#include <unistd.h> /* exit(2) */ static inline
abi_longdo_bsd_exit(void *cpu_env, abi_long arg1)bsd-user/qemu.h +0
-1@@ -17,7 +17,6 @@#ifndef QEMU_H #define QEMU_H -#include "qemu/osdep.h" #include "cpu.h" #include "qemu/units.h" #include "exec/cpu_ldst.h" bsd-user/arm/signal.c +1
-0@@ -17,6 +17,7 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ +#include "qemu/osdep.h" #include "qemu.h" /* bsd-user/arm/target_arch_cpu.c +2
-0@@ -16,6 +16,8 @@* You should have received a copy of the GNU General Public License * along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include "qemu/osdep.h" #include "target_arch.h" void target_cpu_set_tls (CPUARMState *env,target_ulong newtls)bsd-user/freebsd/os-sys.c +1
-0@@ -17,6 +17,7 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ +#include "qemu/osdep.h" #include "qemu.h" #include "target_arch_sysarch.h" bsd-user/i386/signal.c +1
-0@@ -17,6 +17,7 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ +#include "qemu/osdep.h" #include "qemu.h" /* bsd-user/i386/target_arch_cpu.c +1
-2@@ -17,9 +17,8 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ -#include <sys/types.h> -#include "qemu/osdep.h" +#include "cpu.h" #include "qemu.h" #include "qemu/timer.h" bsd-user/main.c +1
-3@@ -18,12 +18,10 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ -#include <sys/types.h> -#include <sys/time.h> +#include "qemu/osdep.h" #include <sys/resource.h> #include <sys/sysctl.h> -#include "qemu/osdep.h" #include "qemu/help-texts.h" #include "qemu/units.h" #include "qemu/accel.h" bsd-user/strace.c +0
-1@@ -20,7 +20,6 @@#include <sys/select.h> #include <sys/syscall.h> #include <sys/ioccom.h> -#include <ctype.h> #include "qemu.h" bsd-user/x86_64/signal.c +1
-0@@ -16,6 +16,7 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ +#include "qemu/osdep.h" #include "qemu.h" /* bsd-user/x86_64/target_arch_cpu.c +0
-0
bsd-user/x86_64/target_arch_cpu.c line 24
Quoted 10 lines
bsd-user/x86_64/target_arch_cpu.c +1
-2@@ -17,9 +17,8 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ -#include <sys/types.h> -#include "qemu/osdep.h" +#include "cpu.h" #include "qemu.h" #include "qemu/timer.h"
I suppose these are fine. How do I run the cleanup script? I have 2x the number of files not upstream in the bsd-user fork that I'd like to cleanup as well and they are likely a bigger mess and I'll just upstream them in the messy state unless I understand how to keep the neat :).
Warner
Re: [PATCH v4 04/19] bsd-user: Clean up includes
Quoted 42 lines · Warner Losh
Quoted 25 lines · Markus Armbruster
Clean up includes so that
osdep.his included first and headers which it implies are not included manually.This commit was created with
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>--- bsd-user/bsd-proc.h | 4 ---- bsd-user/qemu.h | 1 - bsd-user/arm/signal.c | 1 + bsd-user/arm/target_arch_cpu.c | 2 ++ bsd-user/freebsd/os-sys.c | 1 + bsd-user/i386/signal.c | 1 + bsd-user/i386/target_arch_cpu.c | 3 +-- bsd-user/main.c | 4 +--- bsd-user/strace.c | 1 - bsd-user/x86_64/signal.c | 1 + bsd-user/x86_64/target_arch_cpu.c | 3 +-- 11 files changed, 9 insertions(+), 13 deletions(-)bsd-user/bsd-proc.h +0
-0bsd-user/bsd-proc.h line 24
Quoted 8 lines
bsd-user/bsd-proc.h +0
-3@@ -20,11 +20,7 @@#ifndef BSD_PROC_H_ #define BSD_PROC_H_ -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/time.h> #include <sys/resource.h> Did you test this on FreeBSD 12? FreeBSD 13 has started to climb the hill where all includes are independent, but much of that hasn't been merged to 12 yet.
sys/types.h, at least, is documented as a prereq for bothsys/stat.handsys/resource.h.
Quoted 3 lines
I know many of these are in
os-dep.h, and I've had trouble in the bsd-user fork with that and the layout of the code which has arguably way too much in the .h files.
No, I didn't test on FreeBSD 12.
Any .c must include qemu/osdep.h *first*. Any further inclusions of headers qemu/osdep.h includes already are no-ops unless the headers in question lack multiple inclusion guards.
Quoted 3 lines
Also, why didn't you move
sys/resource.hand other such files toos-dep.h? I'm struggling to understand the rules around what is or isn't included where?
This series is "run scripts/clean-includes, split it into reviewable chunks, tidy up blank lines". Moving more includes into qemu/osdep.h is out of scope.
I sympathize with your complaint that QEMU does too much in headers in general, and in qemu/osdep.h in particular.
Quoted 133 lines
Quoted 133 lines
bsd-user/bsd-proc.h +0
-1-#include <unistd.h> /* exit(2) */ static inline
abi_longdo_bsd_exit(void *cpu_env, abi_long arg1)bsd-user/qemu.h +0
-1@@ -17,7 +17,6 @@#ifndef QEMU_H #define QEMU_H -#include "qemu/osdep.h" #include "cpu.h" #include "qemu/units.h" #include "exec/cpu_ldst.h" bsd-user/arm/signal.c +1
-0@@ -17,6 +17,7 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ +#include "qemu/osdep.h" #include "qemu.h" /* bsd-user/arm/target_arch_cpu.c +2
-0@@ -16,6 +16,8 @@* You should have received a copy of the GNU General Public License * along with this program; if not, see <http://www.gnu.org/licenses/>. */ + +#include "qemu/osdep.h" #include "target_arch.h" void target_cpu_set_tls (CPUARMState *env,target_ulong newtls)bsd-user/freebsd/os-sys.c +1
-0@@ -17,6 +17,7 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ +#include "qemu/osdep.h" #include "qemu.h" #include "target_arch_sysarch.h" bsd-user/i386/signal.c +1
-0@@ -17,6 +17,7 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ +#include "qemu/osdep.h" #include "qemu.h" /* bsd-user/i386/target_arch_cpu.c +1
-2@@ -17,9 +17,8 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ -#include <sys/types.h> -#include "qemu/osdep.h" +#include "cpu.h" #include "qemu.h" #include "qemu/timer.h" bsd-user/main.c +1
-3@@ -18,12 +18,10 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ -#include <sys/types.h> -#include <sys/time.h> +#include "qemu/osdep.h" #include <sys/resource.h> #include <sys/sysctl.h> -#include "qemu/osdep.h" #include "qemu/help-texts.h" #include "qemu/units.h" #include "qemu/accel.h" bsd-user/strace.c +0
-1@@ -20,7 +20,6 @@#include <sys/select.h> #include <sys/syscall.h> #include <sys/ioccom.h> -#include <ctype.h> #include "qemu.h" bsd-user/x86_64/signal.c +1
-0@@ -16,6 +16,7 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ +#include "qemu/osdep.h" #include "qemu.h" /* bsd-user/x86_64/target_arch_cpu.c +0
-0@@ -17,9 +17,8 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */
Quoted 13 lines
bsd-user/x86_64/target_arch_cpu.c line 24
Quoted 8 lines
bsd-user/x86_64/target_arch_cpu.c +1
-2-#include <sys/types.h> -#include "qemu/osdep.h" +#include "cpu.h" #include "qemu.h" #include "qemu/timer.h" I suppose these are fine. How do I run the cleanup script? I have 2x the number of files not upstream in the bsd-user fork that I'd like to cleanup as well and they are likely a bigger mess and I'll just upstream them in the messy state unless I understand how to keep the neat :).
I used
$ scripts/clean-includes --check-dup-head --all
Which resulted in a big mess I didn't dare to submit for review :) So I split it up. Easiest way was to identify useful sets of files, add files that include headers from the set, transitively, then run
$ scripts/clean-includes FILES...
--check-dup-head reports possible duplicate inclusions. It is prone to false positives. That's why it merely reports them. You may want to not use it for now.
There's a big usage comment at the beginning of the script.
Hope this helps!
Warner Losh
Reviewed-byRe: [PATCH v4 04/19] bsd-user: Clean up includes
Quoted 45 lines · Markus Armbruster
Quoted 31 lines · Warner Losh
Quoted 28 lines · Markus Armbruster
Clean up includes so that
osdep.his included first and headers which it implies are not included manually.This commit was created with
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>--- bsd-user/bsd-proc.h | 4 ---- bsd-user/qemu.h | 1 - bsd-user/arm/signal.c | 1 + bsd-user/arm/target_arch_cpu.c | 2 ++ bsd-user/freebsd/os-sys.c | 1 + bsd-user/i386/signal.c | 1 + bsd-user/i386/target_arch_cpu.c | 3 +-- bsd-user/main.c | 4 +--- bsd-user/strace.c | 1 - bsd-user/x86_64/signal.c | 1 + bsd-user/x86_64/target_arch_cpu.c | 3 +-- 11 files changed, 9 insertions(+), 13 deletions(-)bsd-user/bsd-proc.h +0
-0@@ -20,11 +20,7 @@#ifndef BSD_PROC_H_ #define BSD_PROC_H_ Quoted 8 lines
bsd-user/bsd-proc.h line 24
Quoted 5 lines
bsd-user/bsd-proc.h +0
-3-#include <sys/types.h> -#include <sys/stat.h> -#include <sys/time.h> #include <sys/resource.h> Did you test this on FreeBSD 12? FreeBSD 13 has started to climb the hill where all includes are independent, but much of that hasn't been merged
to
Quoted 3 lines
12 yet.
sys/types.h, at least, is documented as a prereq for bothsys/stat.handsys/resource.h.
Quoted 7 lines
Quoted 1 line
I know many of these are in
os-dep.h, and I've had trouble in thebsd-user
Quoted 2 lines
fork with that and the layout of the code which has arguably way too much in the .h files.
No, I didn't test on FreeBSD 12.
OK. Fair enough. If it passes the CI tests, then it's likely fine (though if I hit issues, I'll submit patches).
Quoted 4 lines
Any .c must include
qemu/osdep.h*first*. Any further inclusions of headersqemu/osdep.hincludes already are no-ops unless the headers in question lack multiple inclusion guards.
OK.
Quoted 9 lines
Quoted 1 line
Also, why didn't you move
sys/resource.hand other such files to
os-dep.h?Quoted 2 lines
I'm struggling to understand the rules around what is or isn't included where?
This series is "run
scripts/clean-includes, split it into reviewable chunks, tidy up blank lines". Moving more includes intoqemu/osdep.his out of scope.
OK. Fair point. I'm happy with that answer since it tells me I could move things there too, if need be.
Quoted 3 lines
I sympathize with your complaint that QEMU does too much in headers in general, and in
qemu/osdep.hin particular.
Yea, I'm not entirely sure it's a complaint, or if it's an observation of difficulties relative to other code bases... I go back and forth on my opinion of it...
Quoted 166 lines
Quoted 141 lines
Quoted 21 lines
bsd-user/bsd-proc.h +0
-1-#include <unistd.h> /* exit(2) */ static inline
abi_longdo_bsd_exit(void *cpu_env, abi_long arg1)bsd-user/qemu.h +0
-1@@ -17,7 +17,6 @@#ifndef QEMU_H #define QEMU_H -#include "qemu/osdep.h" #include "cpu.h" #include "qemu/units.h" #include "exec/cpu_ldst.h" bsd-user/arm/signal.c +0
-0bsd-user/arm/signal.c line 17
Quoted 1 line
bsd-user/arm/signal.c +0
-0@@ -17,6 +17,7 @@* along with this program; if not, see <http://www.gnu.org/licenses/ .
Quoted 12 lines
bsd-user/arm/signal.c +1
-0*/ +#include "qemu/osdep.h" #include "qemu.h" /* bsd-user/arm/target_arch_cpu.c +0
-0bsd-user/arm/target_arch_cpu.c line 17
Quoted 2 lines
bsd-user/arm/target_arch_cpu.c +0
-0@@ -16,6 +16,8 @@* You should have received a copy of the GNU General Public License * along with this program; if not, see <http://www.gnu.org/licenses/ .
bsd-user/freebsd/os-sys.c line 17
Quoted 12 lines
bsd-user/arm/target_arch_cpu.c +2
-0*/ + +#include "qemu/osdep.h" #include "target_arch.h" void target_cpu_set_tls (CPUARMState *env,target_ulong newtls)bsd-user/freebsd/os-sys.c +0
-0@@ -17,6 +17,7 @@* along with this program; if not, see <http://www.gnu.org/licenses/ .
bsd-user/i386/signal.c line 17
Quoted 12 lines
bsd-user/freebsd/os-sys.c +1
-0*/ +#include "qemu/osdep.h" #include "qemu.h" #include "target_arch_sysarch.h" bsd-user/i386/signal.c +0
-0@@ -17,6 +17,7 @@* along with this program; if not, see <http://www.gnu.org/licenses/ .
bsd-user/i386/target_arch_cpu.c line 17
Quoted 13 lines
bsd-user/i386/signal.c +1
-0*/ +#include "qemu/osdep.h" #include "qemu.h" /* bsd-user/i386/target_arch_cpu.c +0
-0@@ -17,9 +17,8 @@* along with this program; if not, see <http://www.gnu.org/licenses/ .
Quoted 14 lines
bsd-user/i386/target_arch_cpu.c +1
-2*/ -#include <sys/types.h> -#include "qemu/osdep.h" +#include "cpu.h" #include "qemu.h" #include "qemu/timer.h" bsd-user/main.c +0
-0bsd-user/main.c line 18
Quoted 1 line
bsd-user/main.c +0
-0@@ -18,12 +18,10 @@* along with this program; if not, see <http://www.gnu.org/licenses/ .
Quoted 29 lines
bsd-user/main.c +1
-3*/ -#include <sys/types.h> -#include <sys/time.h> +#include "qemu/osdep.h" #include <sys/resource.h> #include <sys/sysctl.h> -#include "qemu/osdep.h" #include "qemu/help-texts.h" #include "qemu/units.h" #include "qemu/accel.h" bsd-user/strace.c +0
-1@@ -20,7 +20,6 @@#include <sys/select.h> #include <sys/syscall.h> #include <sys/ioccom.h> -#include <ctype.h> #include "qemu.h" bsd-user/x86_64/signal.c +0
-0bsd-user/x86_64/signal.c line 16
Quoted 1 line
bsd-user/x86_64/signal.c +0
-0@@ -16,6 +16,7 @@* along with this program; if not, see <http://www.gnu.org/licenses/ .
bsd-user/x86_64/target_arch_cpu.c line 17
Quoted 13 lines
bsd-user/x86_64/signal.c +1
-0*/ +#include "qemu/osdep.h" #include "qemu.h" /* bsd-user/x86_64/target_arch_cpu.c +0
-0@@ -17,9 +17,8 @@* along with this program; if not, see <http://www.gnu.org/licenses/ .
Quoted 2 lines
bsd-user/x86_64/target_arch_cpu.c +0
-0*/ Quoted 11 lines
bsd-user/x86_64/target_arch_cpu.c line 24
Quoted 8 lines
bsd-user/x86_64/target_arch_cpu.c +1
-2-#include <sys/types.h> -#include "qemu/osdep.h" +#include "cpu.h" #include "qemu.h" #include "qemu/timer.h" I suppose these are fine. How do I run the cleanup script? I have 2x the number of files not upstream in the bsd-user fork that I'd like to
cleanup
Quoted 2 lines
as well and they are likely a bigger mess and I'll just upstream them in the messy state unless I understand how to keep the neat :).
I used
$ scripts/clean-includes --check-dup-head --allWhich resulted in a big mess I didn't dare to submit for review :) So I split it up. Easiest way was to identify useful sets of files, add files that include headers from the set, transitively, then run
$ scripts/clean-includes FILES...
Quoted 8 lines
--check-dup-head reports possible duplicate inclusions. It is prone to false positives. That's why it merely reports them. You may want to not use it for now.
There's a big usage comment at the beginning of the script.
Hope this helps!
It does. After your changes land, I'll merge, and run this on the branch. I have a few changes queued up, and have been contemplating changes to my upstreaming workflow to speed the process along...
So I'm happy with it. Thanks for the cleanup and the time to answer my questions.
Warner
Re: [PATCH v4 04/19] bsd-user: Clean up includes
Warner Losh <[email protected]> writes:
[...]
Quoted 4 lines
So I'm happy with it. Thanks for the cleanup and the time to answer my questions.
Reviewed-by Warner Losh <[email protected]>
Thank *you* for reviewing my patch :)
Re: [PATCH v4 04/19] bsd-user: Clean up includes
In reply to Warner LoshQuoted 4 lines · Warner Losh
Also, why didn't you move
sys/resource.hand other such files toos-dep.h? I'm struggling to understand the rules around what is or isn't included where?
The rough rule of thumb is that if some OS needs a compatibility fixup or workaround for a system header (eg not every mmap.h defines MAP_ANONYMOUS; on Windows unistd.h has to come before time.h) then we put that header include and the compat workaround into osdep.h. This avoids "only fails on obscure platform" issues where somebody puts a header include into some specific .c file but not the compat workaround, and it works on the Linux host that most people develop and test on and we only find the problem later.
There's also no doubt some includes there for historical reasons, and some which really are "everybody needs these" convenience ones. But we should probably not add new includes to osdep.h unless they fall into the "working around system header issues" bucket.
thanks
-- PMM
Re: [PATCH v4 04/19] bsd-user: Clean up includes
Quoted 16 lines · Peter Maydell
Quoted 4 lines · Warner Losh
Also, why didn't you move
sys/resource.hand other such files toos-dep.h? I'm struggling to understand the rules around what is or isn't included where?The rough rule of thumb is that if some OS needs a compatibility fixup or workaround for a system header (eg not every
mmap.hdefinesMAP_ANONYMOUS; on Windowsunistd.hhas to come beforetime.h) then we put that header include and the compat workaround intoosdep.h. This avoids "only fails on obscure platform" issues where somebody puts a header include into some specific .c file but not the compat workaround, and it works on the Linux host that most people develop and test on and we only find the problem later.
Quoted 8 lines
There's also no doubt some includes there for historical reasons, and some which really are "everybody needs these" convenience ones. But we should probably not add new includes to
osdep.hunless they fall into the "working around system header issues" bucket.thanks
-- PMM
BTW maybe we should teach checkpatch about that rule:
if a header is in osdep do not include it directly.
Signature · 1 line
MST
Re: [PATCH v4 04/19] bsd-user: Clean up includes
Quoted 23 lines · Michael S. Tsirkin
Quoted 22 lines · Peter Maydell
Quoted 4 lines · Warner Losh
Also, why didn't you move
sys/resource.hand other such files toos-dep.h? I'm struggling to understand the rules around what is or isn't included where?The rough rule of thumb is that if some OS needs a compatibility fixup or workaround for a system header (eg not every
mmap.hdefinesMAP_ANONYMOUS; on Windowsunistd.hhas to come beforetime.h) then we put that header include and the compat workaround intoosdep.h. This avoids "only fails on obscure platform" issues where somebody puts a header include into some specific .c file but not the compat workaround, and it works on the Linux host that most people develop and test on and we only find the problem later.There's also no doubt some includes there for historical reasons, and some which really are "everybody needs these" convenience ones. But we should probably not add new includes to
osdep.hunless they fall into the "working around system header issues" bucket.
Quoted 6 lines
Quoted 2 lines
thanks
-- PMMBTW maybe we should teach checkpatch about that rule:
if a header is in osdep do not include it directly.
To be more precise, make checkpatch run clean-includes somehow? Or just make CI run clean-includes on the tree and verify result is empty?
Quoted 2 lines
Signature · 1 line
MST
Re: [PATCH v4 04/19] bsd-user: Clean up includes
Quoted 28 lines · Michael S. Tsirkin
Quoted 27 lines · Michael S. Tsirkin
Quoted 24 lines · Peter Maydell
Quoted 4 lines · Warner Losh
Also, why didn't you move
sys/resource.hand other such files toos-dep.h? I'm struggling to understand the rules around what is or isn't included where?The rough rule of thumb is that if some OS needs a compatibility fixup or workaround for a system header (eg not every
mmap.hdefinesMAP_ANONYMOUS; on Windowsunistd.hhas to come beforetime.h) then we put that header include and the compat workaround intoosdep.h. This avoids "only fails on obscure platform" issues where somebody puts a header include into some specific .c file but not the compat workaround, and it works on the Linux host that most people develop and test on and we only find the problem later.There's also no doubt some includes there for historical reasons, and some which really are "everybody needs these" convenience ones. But we should probably not add new includes to
osdep.hunless they fall into the "working around system header issues" bucket.thanks
-- PMM
Quoted 6 lines
Quoted 2 lines
BTW maybe we should teach checkpatch about that rule:
if a header is in osdep do not include it directly.To be more precise, make checkpatch run clean-includes somehow? Or just make CI run clean-includes on the tree and verify result is empty?
scripts/clean-includes isn't quite happy even after my series. Offenders:
ebpf/rss.bpf.skeleton.h
subprojects/libvduse/libvduse.h
subprojects/libvhost-user/libvhost-user-glib.h
subprojects/libvhost-user/libvhost-user.h
target/hexagon/idef-parser/idef-parser.h
target/hexagon/idef-parser/parser-helpers.h
tests/fp/platform.h
contrib/plugins/cache.c
contrib/plugins/drcov.c
contrib/plugins/execlog.c
contrib/plugins/hotblocks.c
contrib/plugins/hotpages.c
contrib/plugins/howvec.c
contrib/plugins/hwprofile.c
contrib/plugins/lockstep.c
linux-user/mips64/cpu_loop.c
linux-user/mips64/signal.c
linux-user/x86_64/cpu_loop.c
linux-user/x86_64/signal.c
plugins/core.c
plugins/loader.c
scripts/xen-detect.c
subprojects/libvduse/libvduse.c
subprojects/libvhost-user/libvhost-user-glib.c
subprojects/libvhost-user/libvhost-user.c
subprojects/libvhost-user/link-test.c
target/hexagon/gen_dectree_import.c
target/hexagon/gen_semantics.c
target/hexagon/idef-parser/parser-helpers.c
target/s390x/gen-features.c
tests/migration/s390x/a-b-bios.c
tests/plugin/bb.c
tests/plugin/empty.c
tests/plugin/insn.c
tests/plugin/mem.c
tests/plugin/syscall.c
tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c
tests/unit/test-rcu-simpleq.c
tests/unit/test-rcu-slist.c
tests/unit/test-rcu-tailq.c
tools/ebpf/rss.bpf.cTo support automatic checking, we'd have to fix the ones that need need fixing, and add the remainder to the script's XDIRREGEX.
PATCH v4 5/19 crypto: Clean up includes
In reply to Markus ArmbrusterClean up includes so that osdep.h is included first and headers which it implies are not included manually.
This commit was created with scripts/clean-includes.
--- crypto/block-luks-priv.h | 1 - 1 file changed, 1 deletion(-)
crypto/block-luks-priv.h +0 -1
@@ -18,7 +18,6 @@* */ -#include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/bswap.h"
Signature · 1 line
2.39.0
Re: [PATCH v4 05/19] crypto: Clean up includes
Quoted 9 lines · Markus Armbruster
Clean up includes so that
osdep.his included first and headers which it implies are not included manually.This commit was created with
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>--- crypto/block-luks-priv.h | 1 - 1 file changed, 1 deletion(-)
PATCH v4 6/19 hw/cxl: Clean up includes
In reply to Markus ArmbrusterClean up includes so that osdep.h is included first and headers which it implies are not included manually.
This commit was created with scripts/clean-includes.
--- include/hw/cxl/cxl_component.h | 2 -- include/hw/cxl/cxl_host.h | 1 - include/hw/cxl/cxl_pci.h | 1 - 3 files changed, 4 deletions(-)
include/hw/cxl/cxl_component.h +0 -2
@@ -15,9 +15,7 @@#define CXL2_COMPONENT_CM_REGION_SIZE 0x1000#define CXL2_COMPONENT_BLOCK_SIZE 0x10000 -#include "qemu/compiler.h" #include "qemu/range.h" -#include "qemu/typedefs.h" #include "hw/cxl/cxl_cdat.h" #include "hw/register.h" #include "qapi/error.h"
include/hw/cxl/cxl_host.h +0 -1
@@ -7,7 +7,6 @@* COPYING file in the top-level directory. */ -#include "qemu/osdep.h" #include "hw/cxl/cxl.h" #include "hw/boards.h"
include/hw/cxl/cxl_pci.h +0 -1
@@ -10,7 +10,6 @@#ifndef CXL_PCI_H #define CXL_PCI_H -#include "qemu/compiler.h" #define CXL_VENDOR_ID 0x1e98
Signature · 1 line
2.39.0
PATCH v4 7/19 hw/input: Clean up includes
In reply to Markus ArmbrusterClean up includes so that osdep.h is included first and headers which it implies are not included manually.
This commit was created with scripts/clean-includes.
--- include/hw/input/pl050.h | 1 - hw/input/tsc210x.c | 1 - 2 files changed, 2 deletions(-)
include/hw/input/pl050.h +0 -1
@@ -10,7 +10,6 @@#ifndef HW_PL050_H #define HW_PL050_H -#include "qemu/osdep.h" #include "hw/sysbus.h" #include "migration/vmstate.h" #include "hw/input/ps2.h"
hw/input/tsc210x.c +0 -1
@@ -20,7 +20,6 @@*/ #include "qemu/osdep.h" -#include "qemu/log.h" #include "hw/hw.h" #include "audio/audio.h" #include "qemu/timer.h"
Signature · 1 line
2.39.0
PATCH v4 8/19 hw/tricore: Clean up includes
In reply to Markus ArmbrusterClean up includes so that osdep.h is included first and headers which it implies are not included manually.
This commit was created with scripts/clean-includes.
--- include/hw/tricore/triboard.h | 1 - 1 file changed, 1 deletion(-)
include/hw/tricore/triboard.h +0 -1
@@ -18,7 +18,6 @@* License along with this library; if not, see <http://www.gnu.org/licenses/>. */ -#include "qemu/osdep.h" #include "qapi/error.h" #include "hw/boards.h" #include "sysemu/sysemu.h"
Signature · 1 line
2.39.0
Re: [PATCH v4 08/19] hw/tricore: Clean up includes
Quoted 9 lines · Markus Armbruster
Clean up includes so that
osdep.his included first and headers which it implies are not included manually.This commit was created with
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>--- include/hw/tricore/triboard.h | 1 - 1 file changed, 1 deletion(-)
PATCH v4 9/19 qga: Clean up includes
In reply to Markus ArmbrusterClean up includes so that osdep.h is included first and headers which it implies are not included manually.
This commit was created with scripts/clean-includes.
--- qga/cutils.h | 2 -- qga/commands-posix.c | 1 - qga/cutils.c | 3 ++- 3 files changed, 2 insertions(+), 4 deletions(-)
qga/cutils.h +0 -2
@@ -1,8 +1,6 @@#ifndef CUTILS_H_ #define CUTILS_H_ -#include "qemu/osdep.h" -int qga_open_cloexec (const char *name,int flags,mode_t mode);#endif /* CUTILS_H_ */
qga/commands-posix.c +0 -1
@@ -51,7 +51,6 @@#else #include <net/ethernet.h> #endif -#include <sys/types.h> #ifdef CONFIG_SOLARIS #include <sys/sockio.h> #endif
qga/cutils.c +2 -1
@@ -2,8 +2,9 @@* This work is licensed under the terms of the GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. */ -#include "cutils.h" +#include "qemu/osdep.h" +#include "cutils.h" #include "qapi/error.h" /**
Signature · 1 line
2.39.0
Re: [PATCH v4 09/19] qga: Clean up includes
Quoted 57 lines · Markus Armbruster
Clean up includes so that
osdep.his included first and headers which it implies are not included manually.This commit was created with
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>--- qga/cutils.h | 2 -- qga/commands-posix.c | 1 - qga/cutils.c | 3 ++- 3 files changed, 2 insertions(+), 4 deletions(-)qga/cutils.h +0
-2@@ -1,8 +1,6 @@#ifndef CUTILS_H_ #define CUTILS_H_ -#include "qemu/osdep.h" -int qga_open_cloexec (const char *name,int flags,mode_t mode);#endif /* CUTILS_H_ */ qga/commands-posix.c +0
-1@@ -51,7 +51,6 @@#else #include <net/ethernet.h> #endif -#include <sys/types.h> #ifdef CONFIG_SOLARIS #include <sys/sockio.h> #endif qga/cutils.c +0
-0@@ -2,8 +2,9 @@* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory. */qga/cutils.c +2
-2-#include "cutils.h" +#include "qemu/osdep.h" +#include "cutils.h" #include "qapi/error.h" /** -- 2.39.0
PATCH v4 10/19 migration: Clean up includes
In reply to Markus ArmbrusterClean up includes so that osdep.h is included first and headers which it implies are not included manually.
This commit was created with scripts/clean-includes.
--- include/qemu/userfaultfd.h | 1 - 1 file changed, 1 deletion(-)
include/qemu/userfaultfd.h +0 -1
@@ -13,7 +13,6 @@#ifndef USERFAULTFD_H #define USERFAULTFD_H -#include "qemu/osdep.h" #include "exec/hwaddr.h" #include <linux/userfaultfd.h>
Signature · 1 line
2.39.0
Re: [PATCH v4 10/19] migration: Clean up includes
Quoted 2 lines · * Markus Armbruster ([email protected]) wrote:
Clean up includes so that
osdep.his included first and headers which it implies are not included manually.
That change doesn't seem to match the message; the patch is removing the osdep.h include.
Dave
Quoted 22 lines
This commit was created with
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>--- include/qemu/userfaultfd.h | 1 - 1 file changed, 1 deletion(-)include/qemu/userfaultfd.h +0
-1@@ -13,7 +13,6 @@#ifndef USERFAULTFD_H #define USERFAULTFD_H -#include "qemu/osdep.h" #include "exec/hwaddr.h" #include <linux/userfaultfd.h> Signature · 1 line
2.39.0
Signature · 1 line
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Re: [PATCH v4 10/19] migration: Clean up includes
Quoted 6 lines · Dr. David Alan Gilbert
Quoted 2 lines · * Markus Armbruster ([email protected]) wrote:
Clean up includes so that
osdep.his included first and headers which it implies are not included manually.That change doesn't seem to match the message; the patch is removing the
osdep.hinclude.
It's the commit message scripts/clean-includes creates :)
I can throw in another patch to the script so it mentions it also removes qemu/osdep.h from headers.
Quoted 22 lines
Quoted 22 lines
This commit was created with
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>--- include/qemu/userfaultfd.h | 1 - 1 file changed, 1 deletion(-)include/qemu/userfaultfd.h +0
-1@@ -13,7 +13,6 @@#ifndef USERFAULTFD_H #define USERFAULTFD_H -#include "qemu/osdep.h" #include "exec/hwaddr.h" #include <linux/userfaultfd.h> Signature · 1 line
2.39.0
Dr. David Alan Gilbert
Reviewed-byRe: [PATCH v4 10/19] migration: Clean up includes
Quoted 6 lines · * Markus Armbruster ([email protected]) wrote:
Quoted 4 lines · Dr. David Alan Gilbert
Quoted 2 lines · * Markus Armbruster ([email protected]) wrote:
Clean up includes so that
osdep.his included first and headers which it implies are not included manually.
Quoted 7 lines
Quoted 2 lines
That change doesn't seem to match the message; the patch is removing the
osdep.hinclude.It's the commit message
scripts/clean-includescreates :)I can throw in another patch to the script so it mentions it also removes
qemu/osdep.hfrom headers.
Oh hmm it would be clearer; but OK then, so
Quoted 23 lines
Quoted 22 lines
Quoted 22 lines
This commit was created with
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>--- include/qemu/userfaultfd.h | 1 - 1 file changed, 1 deletion(-)include/qemu/userfaultfd.h +0
-1@@ -13,7 +13,6 @@#ifndef USERFAULTFD_H #define USERFAULTFD_H -#include "qemu/osdep.h" #include "exec/hwaddr.h" #include <linux/userfaultfd.h> Signature · 1 line
2.39.0
Signature · 1 line
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Re: [PATCH v4 10/19] migration: Clean up includes
Quoted 10 lines · Dr. David Alan Gilbert
Quoted 9 lines · * Markus Armbruster ([email protected]) wrote:
Quoted 6 lines · Dr. David Alan Gilbert
Quoted 2 lines · * Markus Armbruster ([email protected]) wrote:
Clean up includes so that
osdep.his included first and headers which it implies are not included manually.That change doesn't seem to match the message; the patch is removing the
osdep.hinclude.
Quoted 6 lines
Quoted 4 lines
It's the commit message
scripts/clean-includescreates :)I can throw in another patch to the script so it mentions it also removes
qemu/osdep.hfrom headers.Oh hmm it would be clearer;
What about
$GITSUBJ: Clean up includes
Clean up includes so that osdep.h is included first in .c and not in .h, and headers which it implies are not included manually.
This commit was created with scripts/clean-includes.
Quoted 3 lines
but OK then, so
Reviewed-by Dr. David Alan Gilbert <[email protected]>
Thanks!
Juan Quintela
Reviewed-byRe: [PATCH v4 10/19] migration: Clean up includes
Quoted 19 lines · Markus Armbruster
Quoted 10 lines · Dr. David Alan Gilbert
Quoted 9 lines · * Markus Armbruster ([email protected]) wrote:
Quoted 6 lines · Dr. David Alan Gilbert
Quoted 2 lines · * Markus Armbruster ([email protected]) wrote:
Clean up includes so that
osdep.his included first and headers which it implies are not included manually.That change doesn't seem to match the message; the patch is removing the
osdep.hinclude.Quoted 6 lines
Quoted 4 lines
It's the commit message
scripts/clean-includescreates :)I can throw in another patch to the script so it mentions it also removes
qemu/osdep.hfrom headers.Oh hmm it would be clearer;
Quoted 13 lines
What about
$GITSUBJ: Clean up includes
Clean up includes so that
osdep.his included first in .c and not in .h, and headers which it implies are not included manually.This commit was created with
scripts/clean-includes.Quoted 3 lines
but OK then, so
Reviewed-by Dr. David Alan Gilbert <[email protected]>
Sounds ok to me.
PATCH v4 11/19 net: Clean up includes
In reply to Markus ArmbrusterClean up includes so that osdep.h is included first and headers which it implies are not included manually.
This commit was created with scripts/clean-includes.
--- net/vmnet_int.h | 1 - 1 file changed, 1 deletion(-)
net/vmnet_int.h +0 -1
@@ -10,7 +10,6 @@#ifndef VMNET_INT_H #define VMNET_INT_H -#include "qemu/osdep.h" #include "vmnet_int.h" #include "clients.h"
Signature · 1 line
2.39.0
Re: [PATCH v4 11/19] net: Clean up includes
Quoted 9 lines · Markus Armbruster
Clean up includes so that
osdep.his included first and headers which it implies are not included manually.This commit was created with
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>--- net/vmnet_int.h | 1 - 1 file changed, 1 deletion(-)
PATCH v4 12/19 target/hexagon: Clean up includes
In reply to Markus ArmbrusterClean up includes so that osdep.h is included first and headers which it implies are not included manually.
This commit was created with scripts/clean-includes.
Changes to standalone programs dropped, because I can't tell whether them not using qemu/osdep.h is intentional:
target/hexagon/gen_dectree_import.c
target/hexagon/gen_semantics.c
target/hexagon/idef-parser/idef-parser.h
target/hexagon/idef-parser/parser-helpers.c
target/hexagon/idef-parser/parser-helpers.h
--- target/hexagon/hex_arch_types.h | 1 - target/hexagon/mmvec/macros.h | 1 - 2 files changed, 2 deletions(-)
target/hexagon/hex_arch_types.h +0 -1
@@ -18,7 +18,6 @@#ifndef HEXAGON_HEX_ARCH_TYPES_H #define HEXAGON_HEX_ARCH_TYPES_H -#include "qemu/osdep.h" #include "mmvec/mmvec.h" #include "qemu/int128.h"
target/hexagon/mmvec/macros.h +0 -1
@@ -18,7 +18,6 @@#ifndef HEXAGON_MMVEC_MACROS_H #define HEXAGON_MMVEC_MACROS_H -#include "qemu/osdep.h" #include "qemu/host-utils.h" #include "arch.h" #include "mmvec/system_ext_mmvec.h"
Signature · 1 line
2.39.0
RE: [PATCH v4 12/19] target/hexagon: Clean up includes
Quoted 23 lines
-----Original Message-----
From: Markus Armbruster <[email protected]>
Sent: Thursday, January 19, 2023 1:00 AM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Taylor Simpson <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: [PATCH v4 12/19] target/hexagon: Clean up includesClean up includes so that
osdep.his included first and headers which it implies are not included manually.This commit was created with
scripts/clean-includes.
Quoted 8 lines
Changes to standalone programs dropped, because I can't tell whether them not using
qemu/osdep.his intentional:
target/hexagon/gen_dectree_import.c
target/hexagon/gen_semantics.c
target/hexagon/idef-parser/idef-parser.h
target/hexagon/idef-parser/parser-helpers.c
target/hexagon/idef-parser/parser-helpers.h
Correct. These are standalone programs not built with the full QEMU context.
Quoted 6 lines
Signed-off-by Markus Armbruster <[email protected]>--- target/hexagon/hex_arch_types.h | 1 - target/hexagon/mmvec/macros.h | 1 - 2 files changed, 2 deletions(-)
Re: [PATCH v4 12/19] target/hexagon: Clean up includes
Quoted 24 lines · Taylor Simpson
Quoted 24 lines
-----Original Message-----
From: Markus Armbruster <[email protected]>
Sent: Thursday, January 19, 2023 1:00 AM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Taylor Simpson <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: [PATCH v4 12/19] target/hexagon: Clean up includesClean up includes so that
osdep.his included first and headers which it implies are not included manually.This commit was created with
scripts/clean-includes.Changes to standalone programs dropped, because I can't tell whether them not using
qemu/osdep.his intentional:
Quoted 7 lines
Quoted 5 lines
target/hexagon/gen_dectree_import.c
target/hexagon/gen_semantics.c
target/hexagon/idef-parser/idef-parser.h
target/hexagon/idef-parser/parser-helpers.c
target/hexagon/idef-parser/parser-helpers.hCorrect. These are standalone programs not built with the full QEMU context.
I'll tweak the commit message like this:
Changes to standalone programs dropped, because these intentionally don't use qemu/osdep.h:
Quoted 7 lines
Quoted 5 lines
Signed-off-by Markus Armbruster <[email protected]>--- target/hexagon/hex_arch_types.h | 1 - target/hexagon/mmvec/macros.h | 1 - 2 files changed, 2 deletions(-)Reviewed-by Taylor Simpson <[email protected]>
Thanks!
PATCH v4 13/19 riscv: Clean up includes
In reply to Markus ArmbrusterClean up includes so that osdep.h is included first and headers which it implies are not included manually.
This commit was created with scripts/clean-includes.
--- target/riscv/pmu.h | 1 - 1 file changed, 1 deletion(-)
target/riscv/pmu.h +0 -1
@@ -16,7 +16,6 @@* this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "qemu/osdep.h" #include "qemu/log.h" #include "cpu.h" #include "qemu/main-loop.h"
Signature · 1 line
2.39.0
Re: [PATCH v4 13/19] riscv: Clean up includes
Quoted 9 lines · Markus Armbruster
Clean up includes so that
osdep.his included first and headers which it implies are not included manually.This commit was created with
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>--- target/riscv/pmu.h | 1 - 1 file changed, 1 deletion(-)
Re: [PATCH v4 13/19] riscv: Clean up includes
In reply to Markus ArmbrusterQuoted 7 lines · Markus Armbruster
Clean up includes so that
osdep.his included first and headers which it implies are not included manually.This commit was created with
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>
Alistair
Quoted 20 lines
--- target/riscv/pmu.h | 1 - 1 file changed, 1 deletion(-)target/riscv/pmu.h +0
-2@@ -16,7 +16,6 @@* this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "qemu/osdep.h" #include "qemu/log.h" #include "cpu.h" #include "qemu/main-loop.h" --2.39.0
PATCH v4 14/19 block: Clean up includes
In reply to Markus ArmbrusterClean up includes so that osdep.h is included first and headers which it implies are not included manually.
This commit was created with scripts/clean-includes.
--- include/block/graph-lock.h | 1 - include/block/write-threshold.h | 2 -- block/qapi.c | 1 - 3 files changed, 4 deletions(-)
include/block/graph-lock.h +0 -1
@@ -20,7 +20,6 @@#ifndef GRAPH_LOCK_H #define GRAPH_LOCK_H -#include "qemu/osdep.h" #include "qemu/clang-tsa.h" #include "qemu/coroutine.h"
include/block/write-threshold.h +0 -2
@@ -13,8 +13,6 @@#ifndef BLOCK_WRITE_THRESHOLD_H #define BLOCK_WRITE_THRESHOLD_H -#include "qemu/typedefs.h" -/* * bdrv_write_threshold_set: *
block/qapi.c +0 -1
@@ -39,7 +39,6 @@#include "qapi/qmp/qstring.h" #include "qemu/qemu-print.h" #include "sysemu/block-backend.h" -#include "qemu/cutils.h" BlockDeviceInfo *bdrv_block_device_info(BlockBackend *blk, BlockDriverState *bs,
Signature · 1 line
2.39.0
Re: [PATCH v4 14/19] block: Clean up includes
Quoted 11 lines · Markus Armbruster
Clean up includes so that
osdep.his included first and headers which it implies are not included manually.This commit was created with
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>--- include/block/graph-lock.h | 1 - include/block/write-threshold.h | 2 -- block/qapi.c | 1 - 3 files changed, 4 deletions(-)
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
PATCH v4 15/19 accel: Clean up includes
In reply to Markus ArmbrusterClean up includes so that osdep.h is included first and headers which it implies are not included manually.
This commit was created with scripts/clean-includes.
--- include/sysemu/accel-blocker.h | 1 - 1 file changed, 1 deletion(-)
include/sysemu/accel-blocker.h +0 -1
@@ -14,7 +14,6 @@#ifndef ACCEL_BLOCKER_H #define ACCEL_BLOCKER_H -#include "qemu/osdep.h" #include "sysemu/cpus.h" extern void accel_blocker_init (void );
Signature · 1 line
2.39.0
Re: [PATCH v4 15/19] accel: Clean up includes
Quoted 9 lines · Markus Armbruster
Clean up includes so that
osdep.his included first and headers which it implies are not included manually.This commit was created with
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>--- include/sysemu/accel-blocker.h | 1 - 1 file changed, 1 deletion(-)
PATCH v4 16/19 Fix non-first inclusions of qemu/osdep.h
In reply to Markus ArmbrusterThis commit was created with scripts/clean-includes.
--- audio/sndioaudio.c | 2 +- backends/hostmem-epc.c | 2 +- block/export/vduse-blk.c | 2 +- hw/hyperv/syndbg.c | 2 +- util/async-teardown.c | 12 ++++-------- 5 files changed, 8 insertions(+), 12 deletions(-)
audio/sndioaudio.c +1 -1
@@ -14,9 +14,9 @@* to recording, which is what guest systems expect. */ +#include "qemu/osdep.h" #include <poll.h> #include <sndio.h> -#include "qemu/osdep.h" #include "qemu/main-loop.h" #include "audio.h" #include "trace.h"
backends/hostmem-epc.c +1 -1
@@ -9,9 +9,9 @@* This work is licensed under the terms of the GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. */ -#include <sys/ioctl.h> #include "qemu/osdep.h" +#include <sys/ioctl.h> #include "qom/object_interfaces.h" #include "qapi/error.h" #include "sysemu/hostmem.h"
block/export/vduse-blk.c +1 -1
@@ -10,9 +10,9 @@* later. See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <sys/eventfd.h> -#include "qemu/osdep.h" #include "qapi/error.h" #include "block/export.h" #include "qemu/error-report.h"
hw/hyperv/syndbg.c +1 -1
@@ -5,8 +5,8 @@* See the COPYING file in the top-level directory. */ -#include "qemu/ctype.h" #include "qemu/osdep.h" +#include "qemu/ctype.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/sockets.h"
util/async-teardown.c +4 -8
@@ -10,16 +10,12 @@* option) any later version. See the COPYING file in the top-level directory. * */ -#include <stdlib.h> -#include <stdio.h> -#include <sys/types.h> -#include <dirent.h> -#include <sys/prctl.h> -#include <signal.h> -#include <sched.h> -#include <unistd.h> #include "qemu/osdep.h" +#include <dirent.h> +#include <sys/prctl.h> +#include <sched.h> +#include "qemu/async-teardown.h" #ifdef _SC_THREAD_STACK_MIN
Signature · 1 line
2.39.0
Re: [PATCH v4 16/19] Fix non-first inclusions of qemu/osdep.h
Quoted 61 lines · Markus Armbruster
This commit was created with
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>--- audio/sndioaudio.c | 2 +- backends/hostmem-epc.c | 2 +- block/export/vduse-blk.c | 2 +- hw/hyperv/syndbg.c | 2 +- util/async-teardown.c | 12 ++++-------- 5 files changed, 8 insertions(+), 12 deletions(-)audio/sndioaudio.c +1
-1@@ -14,9 +14,9 @@* to recording, which is what guest systems expect. */ +#include "qemu/osdep.h" #include <poll.h> #include <sndio.h> -#include "qemu/osdep.h" #include "qemu/main-loop.h" #include "audio.h" #include "trace.h" backends/hostmem-epc.c +1
-1@@ -9,9 +9,9 @@* This work is licensed under the terms of the GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. */ -#include <sys/ioctl.h> #include "qemu/osdep.h" +#include <sys/ioctl.h> #include "qom/object_interfaces.h" #include "qapi/error.h" #include "sysemu/hostmem.h" block/export/vduse-blk.c +1
-1@@ -10,9 +10,9 @@* later. See the COPYING file in the top-level directory. */ +#include "qemu/osdep.h" #include <sys/eventfd.h> -#include "qemu/osdep.h" #include "qapi/error.h" #include "block/export.h" #include "qemu/error-report.h" hw/hyperv/syndbg.c +0
-0
hw/hyperv/syndbg.c line 12
Quoted 9 lines
hw/hyperv/syndbg.c +1
-1@@ -5,8 +5,8 @@* See the COPYING file in the top-level directory. */ -#include "qemu/ctype.h" #include "qemu/osdep.h" +#include "qemu/ctype.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/sockets.h"
Up to here:
Quoted 13 lines
util/async-teardown.c +0
-5@@ -10,16 +10,12 @@* option) any later version. See the COPYING file in the top-level directory. * */ -#include <stdlib.h> -#include <stdio.h> -#include <sys/types.h> -#include <dirent.h> -#include <sys/prctl.h>
util/async-teardown.c line 19
Quoted 10 lines
util/async-teardown.c +4
-3-#include <signal.h> -#include <sched.h> -#include <unistd.h> #include "qemu/osdep.h" +#include <dirent.h> +#include <sys/prctl.h> +#include <sched.h> +#include "qemu/async-teardown.h"
This file has more changes.
Re: [PATCH v4 16/19] Fix non-first inclusions of qemu/osdep.h
Quoted 3 lines · Philippe Mathieu-Daudé
Quoted 2 lines · Markus Armbruster
This commit was created with
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>
[...]
Quoted 21 lines
Up to here:
Reviewed-by Philippe Mathieu-Daudé <[email protected]>Quoted 17 lines
util/async-teardown.c +0
-8@@ -10,16 +10,12 @@* option) any later version. See the COPYING file in the top-level directory. * */ -#include <stdlib.h> -#include <stdio.h> -#include <sys/types.h> -#include <dirent.h> -#include <sys/prctl.h> -#include <signal.h> -#include <sched.h> -#include <unistd.h>
Quoted 8 lines
util/async-teardown.c line 19
Quoted 6 lines
util/async-teardown.c +4
-0#include "qemu/osdep.h" +#include <dirent.h> +#include <sys/prctl.h> +#include <sched.h> +#include "qemu/async-teardown.h" This file has more changes.
I'm not sure I understand.
The patch does two related things:
1. It puts qemu/osdep.h first. The diff makes it look like we leave it in place and move other stuff across, but that's the same.
2. It deletes inclusions of headers qemu/osdep.h already includes:
<stdlib.h>
<stdio.h>
<sys/types.h>
<signal.h>
<unistd.h>What would you like me to change or explain?
Re: [PATCH v4 16/19] Fix non-first inclusions of qemu/osdep.h
Quoted 45 lines · Markus Armbruster
Quoted 3 lines · Philippe Mathieu-Daudé
Quoted 2 lines · Markus Armbruster
This commit was created with
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>[...]
Quoted 21 lines
Up to here:
Reviewed-by Philippe Mathieu-Daudé <[email protected]>Quoted 17 lines
util/async-teardown.c +0
-8@@ -10,16 +10,12 @@* option) any later version. See the COPYING file in the top-level directory. * */ -#include <stdlib.h> -#include <stdio.h> -#include <sys/types.h> -#include <dirent.h> -#include <sys/prctl.h> -#include <signal.h> -#include <sched.h> -#include <unistd.h> Quoted 8 lines
util/async-teardown.c line 19
Quoted 6 lines
util/async-teardown.c +4
-0#include "qemu/osdep.h" +#include <dirent.h> +#include <sys/prctl.h> +#include <sched.h> +#include "qemu/async-teardown.h" This file has more changes.
I'm not sure I understand.
The patch does two related things:
1. It puts
qemu/osdep.hfirst. The diff makes it look like we leave it in place and move other stuff across, but that's the same.
Quoted 7 lines
2. It deletes inclusions of headers
qemu/osdep.halready includes:<stdlib.h> <stdio.h> <sys/types.h> <signal.h> <unistd.h>
Ah, the other files get this done in the "Drop duplicate #include" patch.
Re: [PATCH v4 16/19] Fix non-first inclusions of qemu/osdep.h
Quoted 47 lines · Philippe Mathieu-Daudé
Quoted 40 lines · Markus Armbruster
Quoted 3 lines · Philippe Mathieu-Daudé
Quoted 2 lines · Markus Armbruster
This commit was created with
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>[...]
Quoted 20 lines
Up to here:
Reviewed-by Philippe Mathieu-Daudé <[email protected]>Quoted 16 lines
util/async-teardown.c +0
-8@@ -10,16 +10,12 @@* option) any later version. See the COPYING file in the top-level directory. * */ -#include <stdlib.h> -#include <stdio.h> -#include <sys/types.h> -#include <dirent.h> -#include <sys/prctl.h> -#include <signal.h> -#include <sched.h> -#include <unistd.h> Quoted 8 lines
util/async-teardown.c line 19
Quoted 6 lines
util/async-teardown.c +4
-0#include "qemu/osdep.h" +#include <dirent.h> +#include <sys/prctl.h> +#include <sched.h> +#include "qemu/async-teardown.h" This file has more changes.
I'm not sure I understand.
The patch does two related things:
1. It putsqemu/osdep.hfirst. The diff makes it look like we leave it in place and move other stuff across, but that's the same.
2. It deletes inclusions of headersqemu/osdep.halready includes:Quoted 5 lines
<stdlib.h> <stdio.h> <sys/types.h> <signal.h> <unistd.h>
Quoted 1 line
Ah, the other files get this done in the "Drop duplicate #include" patch.
Right!
Re: [PATCH v4 16/19] Fix non-first inclusions of qemu/osdep.h
In reply to Philippe Mathieu-DaudéQuoted 47 lines · Philippe Mathieu-Daudé
Quoted 40 lines · Markus Armbruster
Quoted 3 lines · Philippe Mathieu-Daudé
Quoted 2 lines · Markus Armbruster
This commit was created with
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>[...]
Quoted 20 lines
Up to here:
Reviewed-by Philippe Mathieu-Daudé <[email protected]>Quoted 16 lines
util/async-teardown.c +0
-8@@ -10,16 +10,12 @@* option) any later version. See the COPYING file in the top-level directory. * */ -#include <stdlib.h> -#include <stdio.h> -#include <sys/types.h> -#include <dirent.h> -#include <sys/prctl.h> -#include <signal.h> -#include <sched.h> -#include <unistd.h> Quoted 8 lines
util/async-teardown.c line 19
Quoted 6 lines
util/async-teardown.c +4
-0#include "qemu/osdep.h" +#include <dirent.h> +#include <sys/prctl.h> +#include <sched.h> +#include "qemu/async-teardown.h" This file has more changes.
I'm not sure I understand.
The patch does two related things:
1. It putsqemu/osdep.hfirst. The diff makes it look like we leave it in place and move other stuff across, but that's the same.
2. It deletes inclusions of headersqemu/osdep.halready includes:Quoted 5 lines
<stdlib.h> <stdio.h> <sys/types.h> <signal.h> <unistd.h>
Quoted 1 line
Ah, the other files get this done in the "Drop duplicate #include" patch.
I assume this extends your R-by to the complete patch. Correct me if I'm wrong, please.
Re: [PATCH v4 16/19] Fix non-first inclusions of qemu/osdep.h
In reply to Markus ArmbrusterQuoted 3 lines · Markus Armbruster
This commit was created with
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>
PATCH v4 17/19 Don't include headers already included by qemu/osdep.h
In reply to Markus ArmbrusterThis commit was created with scripts/clean-includes.
--- backends/tpm/tpm_ioctl.h | 2 -- fsdev/p9array.h | 2 -- include/hw/misc/aspeed_lpc.h | 2 -- include/hw/pci/pcie_doe.h | 1 - include/qemu/async-teardown.h | 2 -- include/qemu/dbus.h | 1 - include/qemu/host-utils.h | 1 - include/sysemu/event-loop-base.h | 1 - accel/tcg/cpu-exec.c | 1 - hw/9pfs/9p.c | 2 -- hw/display/virtio-gpu-udmabuf.c | 1 - hw/i2c/pmbus_device.c | 1 - hw/remote/proxy-memory-listener.c | 1 - hw/sensor/adm1272.c | 1 - hw/usb/dev-storage-bot.c | 1 - hw/usb/dev-storage-classic.c | 1 - softmmu/vl.c | 2 -- tcg/tci.c | 1 - tests/unit/test-seccomp.c | 1 - ui/udmabuf.c | 1 - util/main-loop.c | 1 - util/oslib-posix.c | 2 -- 22 files changed, 29 deletions(-)
backends/tpm/tpm_ioctl.h +0 -2
@@ -12,8 +12,6 @@# define __USE_LINUX_IOCTL_DEFS#endif -#include <stdint.h> -#include <sys/types.h> #ifndef _WIN32#include <sys/uio.h> #include <sys/ioctl.h>
fsdev/p9array.h +0 -2
@@ -27,8 +27,6 @@#ifndef QEMU_P9ARRAY_H #define QEMU_P9ARRAY_H -#include "qemu/compiler.h" -/** * P9Array provides a mechanism to access arrays in common C-style (e.g. by * square bracket [] operator) in conjunction with reference variables that
include/hw/misc/aspeed_lpc.h +0 -2
@@ -12,8 +12,6 @@#include "hw/sysbus.h" -#include <stdint.h> -#define TYPE_ASPEED_LPC "aspeed.lpc"#define ASPEED_LPC (obj) OBJECT_CHECK(AspeedLPCState, (obj), TYPE_ASPEED_LPC)
include/hw/pci/pcie_doe.h +0 -1
@@ -11,7 +11,6 @@#define PCIE_DOE_H #include "qemu/range.h" -#include "qemu/typedefs.h" #include "hw/register.h" /*
include/qemu/async-teardown.h +0 -2
@@ -13,8 +13,6 @@#ifndef QEMU_ASYNC_TEARDOWN_H #define QEMU_ASYNC_TEARDOWN_H -#include "config-host.h" -#ifdef CONFIG_LINUX void init_async_teardown (void );#endif
include/qemu/dbus.h +0 -1
@@ -15,7 +15,6 @@#include "qom/object.h" #include "chardev/char.h" #include "qemu/notify.h" -#include "qemu/typedefs.h" /* glib/gio 2.68 */ #define DBUS_METHOD_INVOCATION_HANDLED TRUE
include/qemu/host-utils.h +0 -1
@@ -30,7 +30,6 @@#ifndef HOST_UTILS_H #define HOST_UTILS_H -#include "qemu/compiler.h" #include "qemu/bswap.h" #include "qemu/int128.h"
include/sysemu/event-loop-base.h +0 -1
@@ -14,7 +14,6 @@#include "qom/object.h" #include "block/aio.h" -#include "qemu/typedefs.h" #define TYPE_EVENT_LOOP_BASE "event-loop-base" OBJECT_DECLARE_TYPE(EventLoopBase, EventLoopBaseClass,
accel/tcg/cpu-exec.c +0 -1
@@ -28,7 +28,6 @@#include "exec/exec-all.h" #include "tcg/tcg.h" #include "qemu/atomic.h" -#include "qemu/compiler.h" #include "qemu/timer.h" #include "qemu/rcu.h" #include "exec/log.h"
hw/9pfs/9p.c +0 -2
@@ -19,8 +19,6 @@#include "qemu/osdep.h" #ifdef CONFIG_LINUX #include <linux/limits.h> -#else -#include <limits.h> #endif #include <glib/gprintf.h> #include "hw/virtio/virtio.h"
hw/display/virtio-gpu-udmabuf.c +0 -1
@@ -21,7 +21,6 @@#include "exec/ramblock.h" #include "sysemu/hostmem.h" #include <sys/ioctl.h> -#include <fcntl.h> #include <linux/memfd.h> #include "qemu/memfd.h" #include "standard-headers/linux/udmabuf.h"
hw/i2c/pmbus_device.c +0 -1
@@ -8,7 +8,6 @@#include "qemu/osdep.h" #include <math.h> -#include <string.h> #include "hw/i2c/pmbus_device.h" #include "migration/vmstate.h" #include "qemu/module.h"
hw/remote/proxy-memory-listener.c +0 -1
@@ -8,7 +8,6 @@#include "qemu/osdep.h" -#include "qemu/compiler.h" #include "qemu/int128.h" #include "qemu/range.h" #include "exec/memory.h"
hw/sensor/adm1272.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <string.h> #include "hw/i2c/pmbus_device.h" #include "hw/irq.h" #include "migration/vmstate.h"
hw/usb/dev-storage-bot.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include "qemu/typedefs.h" #include "qapi/error.h" #include "hw/usb.h" #include "hw/usb/desc.h"
hw/usb/dev-storage-classic.c +0 -1
@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include "qemu/typedefs.h" #include "qapi/error.h" #include "qapi/visitor.h" #include "hw/usb.h"
softmmu/vl.c +0 -2
@@ -136,8 +136,6 @@#include "qemu/guest-random.h" #include "qemu/keyval.h" -#include "config-host.h" -#define MAX_VIRTIO_CONSOLES 1 typedef struct BlockdevOptionsQueueEntry {
tcg/tci.c +0 -1
@@ -21,7 +21,6 @@#include "exec/cpu_ldst.h" #include "tcg/tcg-op.h" #include "tcg/tcg-ldst.h" -#include "qemu/compiler.h" #include <ffi.h>
tests/unit/test-seccomp.c +0 -1
@@ -25,7 +25,6 @@#include "qapi/error.h" #include "qemu/module.h" -#include <unistd.h> #include <sys/syscall.h> static void test_seccomp_helper(const char *args, bool killed,
ui/udmabuf.c +0 -1
@@ -8,7 +8,6 @@#include "qapi/error.h" #include "ui/console.h" -#include <fcntl.h> #include <sys/ioctl.h> int udmabuf_fd (void )
util/main-loop.c +0 -1
@@ -33,7 +33,6 @@#include "block/thread-pool.h" #include "qemu/error-report.h" #include "qemu/queue.h" -#include "qemu/compiler.h" #include "qom/object.h" #ifndef _WIN32
util/oslib-posix.c +0 -2
@@ -40,7 +40,6 @@#include "qemu/thread.h" #include <libgen.h> #include "qemu/cutils.h" -#include "qemu/compiler.h" #include "qemu/units.h" #include "qemu/thread-context.h"
@@ -50,7 +49,6 @@#ifdef __FreeBSD__#include <sys/thr.h> -#include <sys/types.h> #include <sys/user.h> #include <libutil.h> #endif
Signature · 1 line
2.39.0
Re: [PATCH v4 17/19] Don't include headers already included by qemu/osdep.h
Quoted 4 lines · CET Markus Armbruster
This commit was created with
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>---
For 9p changes:
Quoted 303 lines
backends/tpm/tpm_ioctl.h | 2 -- fsdev/p9array.h | 2 -- include/hw/misc/aspeed_lpc.h | 2 -- include/hw/pci/pcie_doe.h | 1 - include/qemu/async-teardown.h | 2 -- include/qemu/dbus.h | 1 - include/qemu/host-utils.h | 1 - include/sysemu/event-loop-base.h | 1 - accel/tcg/cpu-exec.c | 1 - hw/9pfs/9p.c | 2 -- hw/display/virtio-gpu-udmabuf.c | 1 - hw/i2c/pmbus_device.c | 1 - hw/remote/proxy-memory-listener.c | 1 - hw/sensor/adm1272.c | 1 - hw/usb/dev-storage-bot.c | 1 - hw/usb/dev-storage-classic.c | 1 - softmmu/vl.c | 2 -- tcg/tci.c | 1 - tests/unit/test-seccomp.c | 1 - ui/udmabuf.c | 1 - util/main-loop.c | 1 - util/oslib-posix.c | 2 -- 22 files changed, 29 deletions(-)backends/tpm/tpm_ioctl.h +0
-2@@ -12,8 +12,6 @@# define __USE_LINUX_IOCTL_DEFS#endif -#include <stdint.h> -#include <sys/types.h> #ifndef _WIN32#include <sys/uio.h> #include <sys/ioctl.h> fsdev/p9array.h +0
-2@@ -27,8 +27,6 @@#ifndef QEMU_P9ARRAY_H #define QEMU_P9ARRAY_H -#include "qemu/compiler.h" -/** * P9Array provides a mechanism to access arrays in common C-style (e.g. by * square bracket [] operator) in conjunction with reference variables that include/hw/misc/aspeed_lpc.h +0
-2@@ -12,8 +12,6 @@#include "hw/sysbus.h" -#include <stdint.h> -#define TYPE_ASPEED_LPC "aspeed.lpc"#define ASPEED_LPC (obj) OBJECT_CHECK(AspeedLPCState, (obj), TYPE_ASPEED_LPC)include/hw/pci/pcie_doe.h +0
-1@@ -11,7 +11,6 @@#define PCIE_DOE_H #include "qemu/range.h" -#include "qemu/typedefs.h" #include "hw/register.h" /* include/qemu/async-teardown.h +0
-2@@ -13,8 +13,6 @@#ifndef QEMU_ASYNC_TEARDOWN_H #define QEMU_ASYNC_TEARDOWN_H -#include "config-host.h" -#ifdef CONFIG_LINUX void init_async_teardown (void );#endif include/qemu/dbus.h +0
-1@@ -15,7 +15,6 @@#include "qom/object.h" #include "chardev/char.h" #include "qemu/notify.h" -#include "qemu/typedefs.h" /* glib/gio 2.68 */ #define DBUS_METHOD_INVOCATION_HANDLED TRUEinclude/qemu/host-utils.h +0
-1@@ -30,7 +30,6 @@#ifndef HOST_UTILS_H #define HOST_UTILS_H -#include "qemu/compiler.h" #include "qemu/bswap.h" #include "qemu/int128.h" include/sysemu/event-loop-base.h +0
-1@@ -14,7 +14,6 @@#include "qom/object.h" #include "block/aio.h" -#include "qemu/typedefs.h" #define TYPE_EVENT_LOOP_BASE "event-loop-base" OBJECT_DECLARE_TYPE(EventLoopBase, EventLoopBaseClass,accel/tcg/cpu-exec.c +0
-1@@ -28,7 +28,6 @@#include "exec/exec-all.h" #include "tcg/tcg.h" #include "qemu/atomic.h" -#include "qemu/compiler.h" #include "qemu/timer.h" #include "qemu/rcu.h" #include "exec/log.h" hw/9pfs/9p.c +0
-2@@ -19,8 +19,6 @@#include "qemu/osdep.h" #ifdef CONFIG_LINUX #include <linux/limits.h> -#else -#include <limits.h> #endif #include <glib/gprintf.h> #include "hw/virtio/virtio.h" hw/display/virtio-gpu-udmabuf.c +0
-1@@ -21,7 +21,6 @@#include "exec/ramblock.h" #include "sysemu/hostmem.h" #include <sys/ioctl.h> -#include <fcntl.h> #include <linux/memfd.h> #include "qemu/memfd.h" #include "standard-headers/linux/udmabuf.h" hw/i2c/pmbus_device.c +0
-1@@ -8,7 +8,6 @@#include "qemu/osdep.h" #include <math.h> -#include <string.h> #include "hw/i2c/pmbus_device.h" #include "migration/vmstate.h" #include "qemu/module.h" hw/remote/proxy-memory-listener.c +0
-1@@ -8,7 +8,6 @@#include "qemu/osdep.h" -#include "qemu/compiler.h" #include "qemu/int128.h" #include "qemu/range.h" #include "exec/memory.h" hw/sensor/adm1272.c +0
-1@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include <string.h> #include "hw/i2c/pmbus_device.h" #include "hw/irq.h" #include "migration/vmstate.h" hw/usb/dev-storage-bot.c +0
-1@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include "qemu/typedefs.h" #include "qapi/error.h" #include "hw/usb.h" #include "hw/usb/desc.h" hw/usb/dev-storage-classic.c +0
-1@@ -8,7 +8,6 @@*/ #include "qemu/osdep.h" -#include "qemu/typedefs.h" #include "qapi/error.h" #include "qapi/visitor.h" #include "hw/usb.h" softmmu/vl.c +0
-2@@ -136,8 +136,6 @@#include "qemu/guest-random.h" #include "qemu/keyval.h" -#include "config-host.h" -#define MAX_VIRTIO_CONSOLES 1 typedef struct BlockdevOptionsQueueEntry {tcg/tci.c +0
-1@@ -21,7 +21,6 @@#include "exec/cpu_ldst.h" #include "tcg/tcg-op.h" #include "tcg/tcg-ldst.h" -#include "qemu/compiler.h" #include <ffi.h> tests/unit/test-seccomp.c +0
-1@@ -25,7 +25,6 @@#include "qapi/error.h" #include "qemu/module.h" -#include <unistd.h> #include <sys/syscall.h> static void test_seccomp_helper(const char *args, bool killed,ui/udmabuf.c +0
-1@@ -8,7 +8,6 @@#include "qapi/error.h" #include "ui/console.h" -#include <fcntl.h> #include <sys/ioctl.h> int udmabuf_fd (void )util/main-loop.c +0
-1@@ -33,7 +33,6 @@#include "block/thread-pool.h" #include "qemu/error-report.h" #include "qemu/queue.h" -#include "qemu/compiler.h" #include "qom/object.h" #ifndef _WIN32util/oslib-posix.c +0
-2@@ -40,7 +40,6 @@#include "qemu/thread.h" #include <libgen.h> #include "qemu/cutils.h" -#include "qemu/compiler.h" #include "qemu/units.h" #include "qemu/thread-context.h" @@ -50,7 +49,6 @@#ifdef __FreeBSD__#include <sys/thr.h> -#include <sys/types.h> #include <sys/user.h> #include <libutil.h> #endif
PATCH v4 18/19 9p: Drop superfluous include of linux/limits.h
In reply to Markus Armbruster--- hw/9pfs/9p.c | 3 --- 1 file changed, 3 deletions(-)
hw/9pfs/9p.c +0 -3
@@ -17,9 +17,6 @@*/ #include "qemu/osdep.h" -#ifdef CONFIG_LINUX -#include <linux/limits.h> -#endif #include <glib/gprintf.h> #include "hw/virtio/virtio.h" #include "qapi/error.h"
Signature · 1 line
2.39.0
Re: [PATCH v4 18/19] 9p: Drop superfluous include of linux/limits.h
Quoted 11 lines · CET Markus Armbruster
Signed-off-by Markus Armbruster <[email protected]>--- hw/9pfs/9p.c | 3 --- 1 file changed, 3 deletions(-)hw/9pfs/9p.c +0
-0
hw/9pfs/9p.c line 22
Quoted 9 lines
hw/9pfs/9p.c +0
-3@@ -17,9 +17,6 @@*/ #include "qemu/osdep.h" -#ifdef CONFIG_LINUX -#include <linux/limits.h> -#endif #include <glib/gprintf.h> #include "hw/virtio/virtio.h" #include "qapi/error.h"
Where did that base version come from? I don't see it anywhere in history. Last relevant change in context was a136d17590a.
Best regards,
Christian Schoenebeck
Re: [PATCH v4 18/19] 9p: Drop superfluous include of linux/limits.h
Quoted 13 lines · Christian Schoenebeck
Quoted 12 lines · CET Markus Armbruster
Signed-off-by Markus Armbruster <[email protected]>--- hw/9pfs/9p.c | 3 --- 1 file changed, 3 deletions(-)hw/9pfs/9p.c +0
-0@@ -17,9 +17,6 @@*/
Quoted 11 lines
hw/9pfs/9p.c line 22
Quoted 8 lines
hw/9pfs/9p.c +0
-3#include "qemu/osdep.h" -#ifdef CONFIG_LINUX -#include <linux/limits.h> -#endif #include <glib/gprintf.h> #include "hw/virtio/virtio.h" #include "qapi/error.h" Where did that base version come from? I don't see it anywhere in history. Last relevant change in context was
a136d17590a.
Current master (7ec8aeb6048) has
#include "qemu/osdep.h"
#ifdef CONFIG_LINUX
#include <linux/limits.h>
#else
#include <limits.h>
#endif
#include <glib/gprintf.h>The previous commit changes it to
#include "qemu/osdep.h"
#ifdef CONFIG_LINUX
#include <linux/limits.h>
#endif
#include <glib/gprintf.h>because "qemu/osdep.h" already includes <limits.h>.
Clearer now?
Christian Schoenebeck
Reviewed-byRe: [PATCH v4 18/19] 9p: Drop superfluous include of linux/limits.h
Quoted 45 lines · CET Markus Armbruster
Quoted 13 lines · Christian Schoenebeck
Quoted 12 lines · CET Markus Armbruster
Signed-off-by Markus Armbruster <[email protected]>--- hw/9pfs/9p.c | 3 --- 1 file changed, 3 deletions(-)hw/9pfs/9p.c +0
-0@@ -17,9 +17,6 @@*/ Quoted 11 lines
hw/9pfs/9p.c line 22
Quoted 8 lines
hw/9pfs/9p.c +0
-3#include "qemu/osdep.h" -#ifdef CONFIG_LINUX -#include <linux/limits.h> -#endif #include <glib/gprintf.h> #include "hw/virtio/virtio.h" #include "qapi/error.h" Where did that base version come from? I don't see it anywhere in history. Last relevant change in context was
a136d17590a.Current master (
7ec8aeb6048) has#include "qemu/osdep.h" #ifdef CONFIG_LINUX #include <linux/limits.h> #else #include <limits.h> #endif #include <glib/gprintf.h>The previous commit changes it to
#include "qemu/osdep.h" #ifdef CONFIG_LINUX #include <linux/limits.h> #endif #include <glib/gprintf.h>
Quoted 3 lines
because "
qemu/osdep.h" already includes <limits.h>.Clearer now?
Ah, right I missed that in your previous patch. Thanks!
Best regards,
Christian Schoenebeck
PATCH v4 19/19 Drop duplicate #include
In reply to Markus ArmbrusterTracked down with the help of scripts/clean-includes.
--- include/hw/arm/fsl-imx6ul.h | 1 - include/hw/arm/fsl-imx7.h | 1 - backends/tpm/tpm_emulator.c | 1 - hw/acpi/piix4.c | 1 - hw/alpha/dp264.c | 1 - hw/arm/virt.c | 1 - hw/arm/xlnx-versal.c | 1 - hw/block/pflash_cfi01.c | 1 - hw/core/machine.c | 1 - hw/hppa/machine.c | 1 - hw/i386/acpi-build.c | 1 - hw/loongarch/acpi-build.c | 1 - hw/misc/macio/cuda.c | 1 - hw/misc/macio/pmu.c | 1 - hw/net/xilinx_axienet.c | 1 - hw/ppc/ppc405_uc.c | 2 -- hw/ppc/ppc440_bamboo.c | 1 - hw/ppc/spapr_drc.c | 1 - hw/rdma/vmw/pvrdma_dev_ring.c | 1 - hw/remote/machine.c | 1 - hw/remote/remote-obj.c | 1 - hw/rtc/mc146818rtc.c | 1 - hw/s390x/virtio-ccw-serial.c | 1 - migration/postcopy-ram.c | 2 -- softmmu/dirtylimit.c | 1 - softmmu/runstate.c | 1 - softmmu/vl.c | 1 - target/loongarch/translate.c | 1 - target/mips/tcg/translate.c | 1 - target/nios2/translate.c | 2 -- tests/unit/test-cutils.c | 1 - ui/gtk.c | 1 - util/oslib-posix.c | 4 ---- 33 files changed, 39 deletions(-)
include/hw/arm/fsl-imx6ul.h +0 -1
@@ -30,7 +30,6 @@#include "hw/timer/imx_gpt.h" #include "hw/timer/imx_epit.h" #include "hw/i2c/imx_i2c.h" -#include "hw/gpio/imx_gpio.h" #include "hw/sd/sdhci.h" #include "hw/ssi/imx_spi.h" #include "hw/net/imx_fec.h"
include/hw/arm/fsl-imx7.h +0 -1
@@ -32,7 +32,6 @@#include "hw/timer/imx_gpt.h" #include "hw/timer/imx_epit.h" #include "hw/i2c/imx_i2c.h" -#include "hw/gpio/imx_gpio.h" #include "hw/sd/sdhci.h" #include "hw/ssi/imx_spi.h" #include "hw/net/imx_fec.h"
backends/tpm/tpm_emulator.c +0 -1
@@ -35,7 +35,6 @@#include "sysemu/runstate.h" #include "sysemu/tpm_backend.h" #include "sysemu/tpm_util.h" -#include "sysemu/runstate.h" #include "tpm_int.h" #include "tpm_ioctl.h" #include "migration/blocker.h"
hw/acpi/piix4.c +0 -1
@@ -35,7 +35,6 @@#include "sysemu/xen.h" #include "qapi/error.h" #include "qemu/range.h" -#include "hw/acpi/pcihp.h" #include "hw/acpi/cpu_hotplug.h" #include "hw/acpi/cpu.h" #include "hw/hotplug.h"
hw/alpha/dp264.c +0 -1
@@ -18,7 +18,6 @@#include "net/net.h" #include "qemu/cutils.h" #include "qemu/datadir.h" -#include "net/net.h" static uint64_t cpu_alpha_superpage_to_phys (void *opaque,uint64_t addr) {
hw/arm/virt.c +0 -1
@@ -33,7 +33,6 @@#include "qemu/units.h" #include "qemu/option.h" #include "monitor/qdev.h" -#include "qapi/error.h" #include "hw/sysbus.h" #include "hw/arm/boot.h" #include "hw/arm/primecell.h"
hw/arm/xlnx-versal.c +0 -1
@@ -22,7 +22,6 @@#include "hw/misc/unimp.h" #include "hw/arm/xlnx-versal.h" #include "qemu/log.h" -#include "hw/sysbus.h" #define XLNX_VERSAL_ACPU_TYPE ARM_CPU_TYPE_NAME("cortex-a72")#define XLNX_VERSAL_RCPU_TYPE ARM_CPU_TYPE_NAME("cortex-r5f")
hw/block/pflash_cfi01.c +0 -1
@@ -45,7 +45,6 @@#include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/bitops.h" -#include "qemu/error-report.h" #include "qemu/host-utils.h" #include "qemu/log.h" #include "qemu/module.h"
hw/core/machine.c +0 -1
@@ -39,7 +39,6 @@#include "exec/confidential-guest-support.h" #include "hw/virtio/virtio.h" #include "hw/virtio/virtio-pci.h" -#include "qom/object_interfaces.h" GlobalProperty hw_compat_7_2[] = {};const size_t hw_compat_7_2_len =G_N_ELEMENTS (hw_compat_7_2);
hw/hppa/machine.c +0 -1
@@ -28,7 +28,6 @@#include "qapi/error.h" #include "net/net.h" #include "qemu/log.h" -#include "net/net.h" #define MIN_SEABIOS_HPPA_VERSION 6/* require at least this fw version */
hw/i386/acpi-build.c +0 -1
@@ -76,7 +76,6 @@#include "hw/acpi/hmat.h" #include "hw/acpi/viot.h" -#include "hw/acpi/cxl.h" #include CONFIG_DEVICES
hw/loongarch/acpi-build.c +0 -1
@@ -22,7 +22,6 @@/* Supported chipsets: */ #include "hw/pci-host/ls7a.h" #include "hw/loongarch/virt.h" -#include "hw/acpi/aml-build.h" #include "hw/acpi/utils.h" #include "hw/acpi/pci.h"
hw/misc/macio/cuda.c +0 -1
@@ -30,7 +30,6 @@#include "hw/input/adb.h" #include "hw/misc/mos6522.h" #include "hw/misc/macio/cuda.h" -#include "qapi/error.h" #include "qemu/timer.h" #include "sysemu/runstate.h" #include "sysemu/rtc.h"
hw/misc/macio/pmu.c +0 -1
@@ -36,7 +36,6 @@#include "hw/misc/mos6522.h" #include "hw/misc/macio/gpio.h" #include "hw/misc/macio/pmu.h" -#include "qapi/error.h" #include "qemu/timer.h" #include "sysemu/runstate.h" #include "sysemu/rtc.h"
hw/net/xilinx_axienet.c +0 -1
@@ -31,7 +31,6 @@#include "net/net.h" #include "net/checksum.h" -#include "hw/hw.h" #include "hw/irq.h" #include "hw/qdev-properties.h" #include "hw/stream.h"
hw/ppc/ppc405_uc.c +0 -2
@@ -38,8 +38,6 @@#include "sysemu/sysemu.h" #include "exec/address-spaces.h" #include "hw/intc/ppc-uic.h" -#include "hw/qdev-properties.h" -#include "qapi/error.h" #include "trace.h" /*****************************************************************************/
hw/ppc/ppc440_bamboo.c +0 -1
@@ -13,7 +13,6 @@#include "qemu/osdep.h" #include "qemu/units.h" -#include "qemu/error-report.h" #include "qemu/datadir.h" #include "qemu/error-report.h" #include "net/net.h"
hw/ppc/spapr_drc.c +0 -1
@@ -17,7 +17,6 @@#include "hw/ppc/spapr_drc.h" #include "qom/object.h" #include "migration/vmstate.h" -#include "qapi/error.h" #include "qapi/qapi-events-qdev.h" #include "qapi/visitor.h" #include "qemu/error-report.h"
hw/rdma/vmw/pvrdma_dev_ring.c +0 -1
@@ -14,7 +14,6 @@*/ #include "qemu/osdep.h" -#include "qemu/cutils.h" #include "hw/pci/pci.h" #include "cpu.h" #include "qemu/cutils.h"
hw/remote/machine.c +0 -1
@@ -22,7 +22,6 @@#include "hw/remote/iohub.h" #include "hw/remote/iommu.h" #include "hw/qdev-core.h" -#include "hw/remote/iommu.h" #include "hw/remote/vfio-user-obj.h" #include "hw/pci/msi.h"
hw/remote/remote-obj.c +0 -1
@@ -12,7 +12,6 @@#include "qemu/error-report.h" #include "qemu/notify.h" #include "qom/object_interfaces.h" -#include "hw/qdev-core.h" #include "io/channel.h" #include "hw/qdev-core.h" #include "hw/remote/machine.h"
hw/rtc/mc146818rtc.c +0 -1
@@ -43,7 +43,6 @@#include "qapi/error.h" #include "qapi/qapi-events-misc.h" #include "qapi/visitor.h" -#include "hw/rtc/mc146818rtc_regs.h" //#define DEBUG_CMOS //#define DEBUG_COALESCED
hw/s390x/virtio-ccw-serial.c +0 -1
@@ -15,7 +15,6 @@#include "hw/qdev-properties.h" #include "hw/virtio/virtio-serial.h" #include "virtio-ccw.h" -#include "hw/virtio/virtio-serial.h" #define TYPE_VIRTIO_SERIAL_CCW "virtio-serial-ccw"OBJECT_DECLARE_SIMPLE_TYPE (VirtioSerialCcw,VIRTIO_SERIAL_CCW )
migration/postcopy-ram.c +0 -2
@@ -17,7 +17,6 @@*/ #include "qemu/osdep.h" -#include "qemu/rcu.h" #include "qemu/madvise.h" #include "exec/target_page.h" #include "migration.h"
@@ -34,7 +33,6 @@#include "hw/boards.h" #include "exec/ramblock.h" #include "socket.h" -#include "qemu-file.h" #include "yank_functions.h" #include "tls.h"
softmmu/dirtylimit.c +0 -1
@@ -11,7 +11,6 @@*/ #include "qemu/osdep.h" -#include "qapi/error.h" #include "qemu/main-loop.h" #include "qapi/qapi-commands-migration.h" #include "qapi/qmp/qdict.h"
softmmu/runstate.c +0 -1
@@ -41,7 +41,6 @@#include "qapi/qapi-commands-run-state.h" #include "qapi/qapi-events-run-state.h" #include "qemu/error-report.h" -#include "qemu/log.h" #include "qemu/job.h" #include "qemu/log.h" #include "qemu/module.h"
softmmu/vl.c +0 -1
@@ -129,7 +129,6 @@#include "qapi/qapi-commands-misc.h" #include "qapi/qapi-visit-qom.h" #include "qapi/qapi-commands-ui.h" -#include "qapi/qmp/qdict.h" #include "block/qdict.h" #include "qapi/qmp/qerror.h" #include "sysemu/iothread.h"
target/loongarch/translate.c +0 -1
@@ -12,7 +12,6 @@#include "exec/helper-proto.h" #include "exec/helper-gen.h" -#include "exec/translator.h" #include "exec/log.h" #include "qemu/qemu-print.h" #include "fpu/softfloat.h"
target/mips/tcg/translate.c +0 -1
@@ -32,7 +32,6 @@#include "semihosting/semihost.h" #include "trace.h" -#include "exec/translator.h" #include "exec/log.h" #include "qemu/qemu-print.h" #include "fpu_helper.h"
target/nios2/translate.c +0 -2
@@ -938,8 +938,6 @@ static const char * const cr_regnames[NUM_CR_REGS] = { };#endif -#include "exec/gen-icount.h" -/* generate intermediate code for basic block 'tb'. */ static void nios2_tr_init_disas_context (DisasContextBase *dcbase,CPUState *cs) {
tests/unit/test-cutils.c +0 -1
@@ -26,7 +26,6 @@*/ #include "qemu/osdep.h" -#include "qemu/units.h" #include "qemu/cutils.h" #include "qemu/units.h"
ui/gtk.c +0 -1
@@ -53,7 +53,6 @@#include <math.h> #include "trace.h" -#include "qemu/cutils.h" #include "ui/input.h" #include "sysemu/runstate.h" #include "sysemu/sysemu.h"
util/oslib-posix.c +0 -4
@@ -59,10 +59,6 @@#include "qemu/mmap-alloc.h" -#ifdef CONFIG_DEBUG_STACK_USAGE -#include "qemu/error-report.h" -#endif -#define MAX_MEM_PREALLOC_THREAD_COUNT 16struct MemsetThread ;
Signature · 1 line
2.39.0
Re: [PATCH v4 19/19] Drop duplicate #include
Quoted 329 lines · * Markus Armbruster ([email protected]) wrote:
Tracked down with the help of
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>--- include/hw/arm/fsl-imx6ul.h | 1 - include/hw/arm/fsl-imx7.h | 1 - backends/tpm/tpm_emulator.c | 1 - hw/acpi/piix4.c | 1 - hw/alpha/dp264.c | 1 - hw/arm/virt.c | 1 - hw/arm/xlnx-versal.c | 1 - hw/block/pflash_cfi01.c | 1 - hw/core/machine.c | 1 - hw/hppa/machine.c | 1 - hw/i386/acpi-build.c | 1 - hw/loongarch/acpi-build.c | 1 - hw/misc/macio/cuda.c | 1 - hw/misc/macio/pmu.c | 1 - hw/net/xilinx_axienet.c | 1 - hw/ppc/ppc405_uc.c | 2 -- hw/ppc/ppc440_bamboo.c | 1 - hw/ppc/spapr_drc.c | 1 - hw/rdma/vmw/pvrdma_dev_ring.c | 1 - hw/remote/machine.c | 1 - hw/remote/remote-obj.c | 1 - hw/rtc/mc146818rtc.c | 1 - hw/s390x/virtio-ccw-serial.c | 1 - migration/postcopy-ram.c | 2 -- softmmu/dirtylimit.c | 1 - softmmu/runstate.c | 1 - softmmu/vl.c | 1 - target/loongarch/translate.c | 1 - target/mips/tcg/translate.c | 1 - target/nios2/translate.c | 2 -- tests/unit/test-cutils.c | 1 - ui/gtk.c | 1 - util/oslib-posix.c | 4 ---- 33 files changed, 39 deletions(-)include/hw/arm/fsl-imx6ul.h +0
-1@@ -30,7 +30,6 @@#include "hw/timer/imx_gpt.h" #include "hw/timer/imx_epit.h" #include "hw/i2c/imx_i2c.h" -#include "hw/gpio/imx_gpio.h" #include "hw/sd/sdhci.h" #include "hw/ssi/imx_spi.h" #include "hw/net/imx_fec.h" include/hw/arm/fsl-imx7.h +0
-1@@ -32,7 +32,6 @@#include "hw/timer/imx_gpt.h" #include "hw/timer/imx_epit.h" #include "hw/i2c/imx_i2c.h" -#include "hw/gpio/imx_gpio.h" #include "hw/sd/sdhci.h" #include "hw/ssi/imx_spi.h" #include "hw/net/imx_fec.h" backends/tpm/tpm_emulator.c +0
-1@@ -35,7 +35,6 @@#include "sysemu/runstate.h" #include "sysemu/tpm_backend.h" #include "sysemu/tpm_util.h" -#include "sysemu/runstate.h" #include "tpm_int.h" #include "tpm_ioctl.h" #include "migration/blocker.h" hw/acpi/piix4.c +0
-1@@ -35,7 +35,6 @@#include "sysemu/xen.h" #include "qapi/error.h" #include "qemu/range.h" -#include "hw/acpi/pcihp.h" #include "hw/acpi/cpu_hotplug.h" #include "hw/acpi/cpu.h" #include "hw/hotplug.h" hw/alpha/dp264.c +0
-1@@ -18,7 +18,6 @@#include "net/net.h" #include "qemu/cutils.h" #include "qemu/datadir.h" -#include "net/net.h" static uint64_t cpu_alpha_superpage_to_phys (void *opaque,uint64_t addr) {hw/arm/virt.c +0
-1@@ -33,7 +33,6 @@#include "qemu/units.h" #include "qemu/option.h" #include "monitor/qdev.h" -#include "qapi/error.h" #include "hw/sysbus.h" #include "hw/arm/boot.h" #include "hw/arm/primecell.h" hw/arm/xlnx-versal.c +0
-1@@ -22,7 +22,6 @@#include "hw/misc/unimp.h" #include "hw/arm/xlnx-versal.h" #include "qemu/log.h" -#include "hw/sysbus.h" #define XLNX_VERSAL_ACPU_TYPE ARM_CPU_TYPE_NAME("cortex-a72")#define XLNX_VERSAL_RCPU_TYPE ARM_CPU_TYPE_NAME("cortex-r5f")hw/block/pflash_cfi01.c +0
-1@@ -45,7 +45,6 @@#include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/bitops.h" -#include "qemu/error-report.h" #include "qemu/host-utils.h" #include "qemu/log.h" #include "qemu/module.h" hw/core/machine.c +0
-1@@ -39,7 +39,6 @@#include "exec/confidential-guest-support.h" #include "hw/virtio/virtio.h" #include "hw/virtio/virtio-pci.h" -#include "qom/object_interfaces.h" GlobalProperty hw_compat_7_2[] = {};const size_t hw_compat_7_2_len =G_N_ELEMENTS (hw_compat_7_2);hw/hppa/machine.c +0
-1@@ -28,7 +28,6 @@#include "qapi/error.h" #include "net/net.h" #include "qemu/log.h" -#include "net/net.h" #define MIN_SEABIOS_HPPA_VERSION 6/* require at least this fw version */ hw/i386/acpi-build.c +0
-1@@ -76,7 +76,6 @@#include "hw/acpi/hmat.h" #include "hw/acpi/viot.h" -#include "hw/acpi/cxl.h" #include CONFIG_DEVICES hw/loongarch/acpi-build.c +0
-1@@ -22,7 +22,6 @@/* Supported chipsets: */ #include "hw/pci-host/ls7a.h" #include "hw/loongarch/virt.h" -#include "hw/acpi/aml-build.h" #include "hw/acpi/utils.h" #include "hw/acpi/pci.h" hw/misc/macio/cuda.c +0
-1@@ -30,7 +30,6 @@#include "hw/input/adb.h" #include "hw/misc/mos6522.h" #include "hw/misc/macio/cuda.h" -#include "qapi/error.h" #include "qemu/timer.h" #include "sysemu/runstate.h" #include "sysemu/rtc.h" hw/misc/macio/pmu.c +0
-1@@ -36,7 +36,6 @@#include "hw/misc/mos6522.h" #include "hw/misc/macio/gpio.h" #include "hw/misc/macio/pmu.h" -#include "qapi/error.h" #include "qemu/timer.h" #include "sysemu/runstate.h" #include "sysemu/rtc.h" hw/net/xilinx_axienet.c +0
-1@@ -31,7 +31,6 @@#include "net/net.h" #include "net/checksum.h" -#include "hw/hw.h" #include "hw/irq.h" #include "hw/qdev-properties.h" #include "hw/stream.h" hw/ppc/ppc405_uc.c +0
-2@@ -38,8 +38,6 @@#include "sysemu/sysemu.h" #include "exec/address-spaces.h" #include "hw/intc/ppc-uic.h" -#include "hw/qdev-properties.h" -#include "qapi/error.h" #include "trace.h" /*****************************************************************************/ hw/ppc/ppc440_bamboo.c +0
-1@@ -13,7 +13,6 @@#include "qemu/osdep.h" #include "qemu/units.h" -#include "qemu/error-report.h" #include "qemu/datadir.h" #include "qemu/error-report.h" #include "net/net.h" hw/ppc/spapr_drc.c +0
-1@@ -17,7 +17,6 @@#include "hw/ppc/spapr_drc.h" #include "qom/object.h" #include "migration/vmstate.h" -#include "qapi/error.h" #include "qapi/qapi-events-qdev.h" #include "qapi/visitor.h" #include "qemu/error-report.h" hw/rdma/vmw/pvrdma_dev_ring.c +0
-1@@ -14,7 +14,6 @@*/ #include "qemu/osdep.h" -#include "qemu/cutils.h" #include "hw/pci/pci.h" #include "cpu.h" #include "qemu/cutils.h" hw/remote/machine.c +0
-1@@ -22,7 +22,6 @@#include "hw/remote/iohub.h" #include "hw/remote/iommu.h" #include "hw/qdev-core.h" -#include "hw/remote/iommu.h" #include "hw/remote/vfio-user-obj.h" #include "hw/pci/msi.h" hw/remote/remote-obj.c +0
-1@@ -12,7 +12,6 @@#include "qemu/error-report.h" #include "qemu/notify.h" #include "qom/object_interfaces.h" -#include "hw/qdev-core.h" #include "io/channel.h" #include "hw/qdev-core.h" #include "hw/remote/machine.h" hw/rtc/mc146818rtc.c +0
-1@@ -43,7 +43,6 @@#include "qapi/error.h" #include "qapi/qapi-events-misc.h" #include "qapi/visitor.h" -#include "hw/rtc/mc146818rtc_regs.h" //#define DEBUG_CMOS //#define DEBUG_COALESCED hw/s390x/virtio-ccw-serial.c +0
-1@@ -15,7 +15,6 @@#include "hw/qdev-properties.h" #include "hw/virtio/virtio-serial.h" #include "virtio-ccw.h" -#include "hw/virtio/virtio-serial.h" #define TYPE_VIRTIO_SERIAL_CCW "virtio-serial-ccw"OBJECT_DECLARE_SIMPLE_TYPE (VirtioSerialCcw,VIRTIO_SERIAL_CCW )migration/postcopy-ram.c +0
-1@@ -17,7 +17,6 @@*/ #include "qemu/osdep.h" -#include "qemu/rcu.h" #include "qemu/madvise.h" #include "exec/target_page.h" #include "migration.h"
migration/postcopy-ram.c line 37
Quoted 6 lines
migration/postcopy-ram.c +0
-1@@ -34,7 +33,6 @@#include "hw/boards.h" #include "exec/ramblock.h" #include "socket.h" -#include "qemu-file.h" #include "yank_functions.h" #include "tls.h"
Quoted 116 lines
softmmu/dirtylimit.c +0
-1@@ -11,7 +11,6 @@*/ #include "qemu/osdep.h" -#include "qapi/error.h" #include "qemu/main-loop.h" #include "qapi/qapi-commands-migration.h" #include "qapi/qmp/qdict.h" softmmu/runstate.c +0
-1@@ -41,7 +41,6 @@#include "qapi/qapi-commands-run-state.h" #include "qapi/qapi-events-run-state.h" #include "qemu/error-report.h" -#include "qemu/log.h" #include "qemu/job.h" #include "qemu/log.h" #include "qemu/module.h" softmmu/vl.c +0
-1@@ -129,7 +129,6 @@#include "qapi/qapi-commands-misc.h" #include "qapi/qapi-visit-qom.h" #include "qapi/qapi-commands-ui.h" -#include "qapi/qmp/qdict.h" #include "block/qdict.h" #include "qapi/qmp/qerror.h" #include "sysemu/iothread.h" target/loongarch/translate.c +0
-1@@ -12,7 +12,6 @@#include "exec/helper-proto.h" #include "exec/helper-gen.h" -#include "exec/translator.h" #include "exec/log.h" #include "qemu/qemu-print.h" #include "fpu/softfloat.h" target/mips/tcg/translate.c +0
-1@@ -32,7 +32,6 @@#include "semihosting/semihost.h" #include "trace.h" -#include "exec/translator.h" #include "exec/log.h" #include "qemu/qemu-print.h" #include "fpu_helper.h" target/nios2/translate.c +0
-2@@ -938,8 +938,6 @@ static const char * const cr_regnames[NUM_CR_REGS] = { };#endif -#include "exec/gen-icount.h" -/* generate intermediate code for basic block 'tb'. */ static void nios2_tr_init_disas_context (DisasContextBase *dcbase,CPUState *cs) {tests/unit/test-cutils.c +0
-1@@ -26,7 +26,6 @@*/ #include "qemu/osdep.h" -#include "qemu/units.h" #include "qemu/cutils.h" #include "qemu/units.h" ui/gtk.c +0
-1@@ -53,7 +53,6 @@#include <math.h> #include "trace.h" -#include "qemu/cutils.h" #include "ui/input.h" #include "sysemu/runstate.h" #include "sysemu/sysemu.h" util/oslib-posix.c +0
-4@@ -59,10 +59,6 @@#include "qemu/mmap-alloc.h" -#ifdef CONFIG_DEBUG_STACK_USAGE -#include "qemu/error-report.h" -#endif -#define MAX_MEM_PREALLOC_THREAD_COUNT 16struct MemsetThread ;Signature · 1 line
2.39.0
Signature · 1 line
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Re: [PATCH v4 19/19] Drop duplicate #include
In reply to Markus ArmbrusterQuoted 4 lines · On Thu, 19 Jan 2023 07:59:59 +0100 Markus Armbruster <[email protected]> wrote:
Tracked down with the help of
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>---
For ppc changes.
Quoted 444 lines
include/hw/arm/fsl-imx6ul.h | 1 - include/hw/arm/fsl-imx7.h | 1 - backends/tpm/tpm_emulator.c | 1 - hw/acpi/piix4.c | 1 - hw/alpha/dp264.c | 1 - hw/arm/virt.c | 1 - hw/arm/xlnx-versal.c | 1 - hw/block/pflash_cfi01.c | 1 - hw/core/machine.c | 1 - hw/hppa/machine.c | 1 - hw/i386/acpi-build.c | 1 - hw/loongarch/acpi-build.c | 1 - hw/misc/macio/cuda.c | 1 - hw/misc/macio/pmu.c | 1 - hw/net/xilinx_axienet.c | 1 - hw/ppc/ppc405_uc.c | 2 -- hw/ppc/ppc440_bamboo.c | 1 - hw/ppc/spapr_drc.c | 1 - hw/rdma/vmw/pvrdma_dev_ring.c | 1 - hw/remote/machine.c | 1 - hw/remote/remote-obj.c | 1 - hw/rtc/mc146818rtc.c | 1 - hw/s390x/virtio-ccw-serial.c | 1 - migration/postcopy-ram.c | 2 -- softmmu/dirtylimit.c | 1 - softmmu/runstate.c | 1 - softmmu/vl.c | 1 - target/loongarch/translate.c | 1 - target/mips/tcg/translate.c | 1 - target/nios2/translate.c | 2 -- tests/unit/test-cutils.c | 1 - ui/gtk.c | 1 - util/oslib-posix.c | 4 ---- 33 files changed, 39 deletions(-)include/hw/arm/fsl-imx6ul.h +0
-1@@ -30,7 +30,6 @@#include "hw/timer/imx_gpt.h" #include "hw/timer/imx_epit.h" #include "hw/i2c/imx_i2c.h" -#include "hw/gpio/imx_gpio.h" #include "hw/sd/sdhci.h" #include "hw/ssi/imx_spi.h" #include "hw/net/imx_fec.h" include/hw/arm/fsl-imx7.h +0
-1@@ -32,7 +32,6 @@#include "hw/timer/imx_gpt.h" #include "hw/timer/imx_epit.h" #include "hw/i2c/imx_i2c.h" -#include "hw/gpio/imx_gpio.h" #include "hw/sd/sdhci.h" #include "hw/ssi/imx_spi.h" #include "hw/net/imx_fec.h" backends/tpm/tpm_emulator.c +0
-1@@ -35,7 +35,6 @@#include "sysemu/runstate.h" #include "sysemu/tpm_backend.h" #include "sysemu/tpm_util.h" -#include "sysemu/runstate.h" #include "tpm_int.h" #include "tpm_ioctl.h" #include "migration/blocker.h" hw/acpi/piix4.c +0
-1@@ -35,7 +35,6 @@#include "sysemu/xen.h" #include "qapi/error.h" #include "qemu/range.h" -#include "hw/acpi/pcihp.h" #include "hw/acpi/cpu_hotplug.h" #include "hw/acpi/cpu.h" #include "hw/hotplug.h" hw/alpha/dp264.c +0
-1@@ -18,7 +18,6 @@#include "net/net.h" #include "qemu/cutils.h" #include "qemu/datadir.h" -#include "net/net.h" static uint64_t cpu_alpha_superpage_to_phys (void *opaque,uint64_t addr) {hw/arm/virt.c +0
-1@@ -33,7 +33,6 @@#include "qemu/units.h" #include "qemu/option.h" #include "monitor/qdev.h" -#include "qapi/error.h" #include "hw/sysbus.h" #include "hw/arm/boot.h" #include "hw/arm/primecell.h" hw/arm/xlnx-versal.c +0
-1@@ -22,7 +22,6 @@#include "hw/misc/unimp.h" #include "hw/arm/xlnx-versal.h" #include "qemu/log.h" -#include "hw/sysbus.h" #define XLNX_VERSAL_ACPU_TYPE ARM_CPU_TYPE_NAME("cortex-a72")#define XLNX_VERSAL_RCPU_TYPE ARM_CPU_TYPE_NAME("cortex-r5f")hw/block/pflash_cfi01.c +0
-1@@ -45,7 +45,6 @@#include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/bitops.h" -#include "qemu/error-report.h" #include "qemu/host-utils.h" #include "qemu/log.h" #include "qemu/module.h" hw/core/machine.c +0
-1@@ -39,7 +39,6 @@#include "exec/confidential-guest-support.h" #include "hw/virtio/virtio.h" #include "hw/virtio/virtio-pci.h" -#include "qom/object_interfaces.h" GlobalProperty hw_compat_7_2[] = {};const size_t hw_compat_7_2_len =G_N_ELEMENTS (hw_compat_7_2);hw/hppa/machine.c +0
-1@@ -28,7 +28,6 @@#include "qapi/error.h" #include "net/net.h" #include "qemu/log.h" -#include "net/net.h" #define MIN_SEABIOS_HPPA_VERSION 6/* require at least this fw version */ hw/i386/acpi-build.c +0
-1@@ -76,7 +76,6 @@#include "hw/acpi/hmat.h" #include "hw/acpi/viot.h" -#include "hw/acpi/cxl.h" #include CONFIG_DEVICES hw/loongarch/acpi-build.c +0
-1@@ -22,7 +22,6 @@/* Supported chipsets: */ #include "hw/pci-host/ls7a.h" #include "hw/loongarch/virt.h" -#include "hw/acpi/aml-build.h" #include "hw/acpi/utils.h" #include "hw/acpi/pci.h" hw/misc/macio/cuda.c +0
-1@@ -30,7 +30,6 @@#include "hw/input/adb.h" #include "hw/misc/mos6522.h" #include "hw/misc/macio/cuda.h" -#include "qapi/error.h" #include "qemu/timer.h" #include "sysemu/runstate.h" #include "sysemu/rtc.h" hw/misc/macio/pmu.c +0
-1@@ -36,7 +36,6 @@#include "hw/misc/mos6522.h" #include "hw/misc/macio/gpio.h" #include "hw/misc/macio/pmu.h" -#include "qapi/error.h" #include "qemu/timer.h" #include "sysemu/runstate.h" #include "sysemu/rtc.h" hw/net/xilinx_axienet.c +0
-1@@ -31,7 +31,6 @@#include "net/net.h" #include "net/checksum.h" -#include "hw/hw.h" #include "hw/irq.h" #include "hw/qdev-properties.h" #include "hw/stream.h" hw/ppc/ppc405_uc.c +0
-2@@ -38,8 +38,6 @@#include "sysemu/sysemu.h" #include "exec/address-spaces.h" #include "hw/intc/ppc-uic.h" -#include "hw/qdev-properties.h" -#include "qapi/error.h" #include "trace.h" /*****************************************************************************/ hw/ppc/ppc440_bamboo.c +0
-1@@ -13,7 +13,6 @@#include "qemu/osdep.h" #include "qemu/units.h" -#include "qemu/error-report.h" #include "qemu/datadir.h" #include "qemu/error-report.h" #include "net/net.h" hw/ppc/spapr_drc.c +0
-1@@ -17,7 +17,6 @@#include "hw/ppc/spapr_drc.h" #include "qom/object.h" #include "migration/vmstate.h" -#include "qapi/error.h" #include "qapi/qapi-events-qdev.h" #include "qapi/visitor.h" #include "qemu/error-report.h" hw/rdma/vmw/pvrdma_dev_ring.c +0
-1@@ -14,7 +14,6 @@*/ #include "qemu/osdep.h" -#include "qemu/cutils.h" #include "hw/pci/pci.h" #include "cpu.h" #include "qemu/cutils.h" hw/remote/machine.c +0
-1@@ -22,7 +22,6 @@#include "hw/remote/iohub.h" #include "hw/remote/iommu.h" #include "hw/qdev-core.h" -#include "hw/remote/iommu.h" #include "hw/remote/vfio-user-obj.h" #include "hw/pci/msi.h" hw/remote/remote-obj.c +0
-1@@ -12,7 +12,6 @@#include "qemu/error-report.h" #include "qemu/notify.h" #include "qom/object_interfaces.h" -#include "hw/qdev-core.h" #include "io/channel.h" #include "hw/qdev-core.h" #include "hw/remote/machine.h" hw/rtc/mc146818rtc.c +0
-1@@ -43,7 +43,6 @@#include "qapi/error.h" #include "qapi/qapi-events-misc.h" #include "qapi/visitor.h" -#include "hw/rtc/mc146818rtc_regs.h" //#define DEBUG_CMOS //#define DEBUG_COALESCED hw/s390x/virtio-ccw-serial.c +0
-1@@ -15,7 +15,6 @@#include "hw/qdev-properties.h" #include "hw/virtio/virtio-serial.h" #include "virtio-ccw.h" -#include "hw/virtio/virtio-serial.h" #define TYPE_VIRTIO_SERIAL_CCW "virtio-serial-ccw"OBJECT_DECLARE_SIMPLE_TYPE (VirtioSerialCcw,VIRTIO_SERIAL_CCW )migration/postcopy-ram.c +0
-2@@ -17,7 +17,6 @@*/ #include "qemu/osdep.h" -#include "qemu/rcu.h" #include "qemu/madvise.h" #include "exec/target_page.h" #include "migration.h" @@ -34,7 +33,6 @@#include "hw/boards.h" #include "exec/ramblock.h" #include "socket.h" -#include "qemu-file.h" #include "yank_functions.h" #include "tls.h" softmmu/dirtylimit.c +0
-1@@ -11,7 +11,6 @@*/ #include "qemu/osdep.h" -#include "qapi/error.h" #include "qemu/main-loop.h" #include "qapi/qapi-commands-migration.h" #include "qapi/qmp/qdict.h" softmmu/runstate.c +0
-1@@ -41,7 +41,6 @@#include "qapi/qapi-commands-run-state.h" #include "qapi/qapi-events-run-state.h" #include "qemu/error-report.h" -#include "qemu/log.h" #include "qemu/job.h" #include "qemu/log.h" #include "qemu/module.h" softmmu/vl.c +0
-1@@ -129,7 +129,6 @@#include "qapi/qapi-commands-misc.h" #include "qapi/qapi-visit-qom.h" #include "qapi/qapi-commands-ui.h" -#include "qapi/qmp/qdict.h" #include "block/qdict.h" #include "qapi/qmp/qerror.h" #include "sysemu/iothread.h" target/loongarch/translate.c +0
-1@@ -12,7 +12,6 @@#include "exec/helper-proto.h" #include "exec/helper-gen.h" -#include "exec/translator.h" #include "exec/log.h" #include "qemu/qemu-print.h" #include "fpu/softfloat.h" target/mips/tcg/translate.c +0
-1@@ -32,7 +32,6 @@#include "semihosting/semihost.h" #include "trace.h" -#include "exec/translator.h" #include "exec/log.h" #include "qemu/qemu-print.h" #include "fpu_helper.h" target/nios2/translate.c +0
-2@@ -938,8 +938,6 @@ static const char * const cr_regnames[NUM_CR_REGS] = { };#endif -#include "exec/gen-icount.h" -/* generate intermediate code for basic block 'tb'. */ static void nios2_tr_init_disas_context (DisasContextBase *dcbase,CPUState *cs) {tests/unit/test-cutils.c +0
-1@@ -26,7 +26,6 @@*/ #include "qemu/osdep.h" -#include "qemu/units.h" #include "qemu/cutils.h" #include "qemu/units.h" ui/gtk.c +0
-1@@ -53,7 +53,6 @@#include <math.h> #include "trace.h" -#include "qemu/cutils.h" #include "ui/input.h" #include "sysemu/runstate.h" #include "sysemu/sysemu.h" util/oslib-posix.c +0
-4@@ -59,10 +59,6 @@#include "qemu/mmap-alloc.h" -#ifdef CONFIG_DEBUG_STACK_USAGE -#include "qemu/error-report.h" -#endif -#define MAX_MEM_PREALLOC_THREAD_COUNT 16struct MemsetThread ;
Re: [PATCH v4 19/19] Drop duplicate #include
In reply to Markus ArmbrusterQuoted 18 lines · Markus Armbruster
Tracked down with the help of
scripts/clean-includes.Signed-off-by Markus Armbruster <[email protected]>migration/postcopy-ram.c +0
-1@@ -17,7 +17,6 @@*/ #include "qemu/osdep.h" -#include "qemu/rcu.h" #include "qemu/madvise.h" #include "exec/target_page.h" #include "migration.h"
migration/postcopy-ram.c line 37
Quoted 6 lines
migration/postcopy-ram.c +0
-1@@ -34,7 +33,6 @@#include "hw/boards.h" #include "exec/ramblock.h" #include "socket.h" -#include "qemu-file.h" #include "yank_functions.h" #include "tls.h"
Ouch
I don't want to look into the logs. They *could* say that it was me the one doing the mess.
Quoted 13 lines · Markus Armbruster
Back in 2016, we discussed[1] rules for headers, and these were generally liked:
1. Have a carefully curated header that's included everywhere first. We got that already thanks to Peter:
osdep.h.2. Headers should normally include everything they need beyond
osdep.h. If exceptions are needed for some reason, they must be documented in the header. If all that's needed from a header is typedefs, put those intoqemu/typedefs.hinstead of including the header.3. Cyclic inclusion is forbidden.
Quoted 7 lines
This series fixes violations of rule 2. I may have split patches too aggressively. Let me know if you want some squashed together.
v4:
* PATCH 01-03: New
* PATCH 04-15: Previous version redone withscripts/clean-includes, result split up for review
Copying the R-bys for v3 to these patches is tempting. But I didn't.
Quoted 14 lines
* PATCH 16-19: New
v3:
* Rebased, old PATCH 1+2+4 are in master as commit881e019770..f07ceffdf5
* PATCH 1: Fix bsd-userv2:
* Rebased
* PATCH 3: v1 posted separately
* PATCH 4: New[1] Message-ID: <[email protected]>
https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg03345.html
Quoted 11 lines · Markus Armbruster
Back in 2016, we discussed[1] rules for headers, and these were generally liked:
1. Have a carefully curated header that's included everywhere first. We got that already thanks to Peter:
osdep.h.2. Headers should normally include everything they need beyond
osdep.h. If exceptions are needed for some reason, they must be documented in the header. If all that's needed from a header is typedefs, put those intoqemu/typedefs.hinstead of including the header.
Quoted 4 lines
3. Cyclic inclusion is forbidden.
This series fixes violations of rule 2. I may have split patches too aggressively. Let me know if you want some squashed together.
series
feel free to merge.
Quoted 133 lines
v4:
* PATCH 01-03: New
* PATCH 04-15: Previous version redone withscripts/clean-includes, result split up for review
* PATCH 16-19: Newv3:
* Rebased, old PATCH 1+2+4 are in master as commit881e019770..f07ceffdf5
* PATCH 1: Fix bsd-userv2:
* Rebased
* PATCH 3: v1 posted separately
* PATCH 4: New[1] Message-ID: <[email protected]>
https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg03345.htmlMarkus Armbruster (19):
scripts/clean-includes: Fully skip / ignore filesscripts/clean-includes: Don't claim duplicate headers found when notscripts/clean-includes: Skip symbolic links
bsd-user: Clean up includes
crypto: Clean up includes
hw/cxl: Clean up includes
hw/input: Clean up includes
hw/tricore: Clean up includes
qga: Clean up includes
migration: Clean up includes
net: Clean up includes
target/hexagon: Clean up includes
riscv: Clean up includes
block: Clean up includes
accel: Clean up includes
Fix non-first inclusions ofqemu/osdep.h
Don't include headers already included byqemu/osdep.h9p: Drop superfluous include oflinux/limits.h
Drop duplicate #includebackends/tpm/tpm_ioctl.h | 2 -- bsd-user/bsd-proc.h | 4 ---- bsd-user/qemu.h | 1 - crypto/block-luks-priv.h | 1 - fsdev/p9array.h | 2 -- include/block/graph-lock.h | 1 - include/block/write-threshold.h | 2 -- include/hw/arm/fsl-imx6ul.h | 1 - include/hw/arm/fsl-imx7.h | 1 - include/hw/cxl/cxl_component.h | 2 -- include/hw/cxl/cxl_host.h | 1 - include/hw/cxl/cxl_pci.h | 1 - include/hw/input/pl050.h | 1 - include/hw/misc/aspeed_lpc.h | 2 -- include/hw/pci/pcie_doe.h | 1 - include/hw/tricore/triboard.h | 1 - include/qemu/async-teardown.h | 2 -- include/qemu/dbus.h | 1 - include/qemu/host-utils.h | 1 - include/qemu/userfaultfd.h | 1 - include/sysemu/accel-blocker.h | 1 - include/sysemu/event-loop-base.h | 1 - net/vmnet_int.h | 1 - qga/cutils.h | 2 -- target/hexagon/hex_arch_types.h | 1 - target/hexagon/mmvec/macros.h | 1 - target/riscv/pmu.h | 1 - accel/tcg/cpu-exec.c | 1 - audio/sndioaudio.c | 2 +- backends/hostmem-epc.c | 2 +- backends/tpm/tpm_emulator.c | 1 - block/export/vduse-blk.c | 2 +- block/qapi.c | 1 - bsd-user/arm/signal.c | 1 + bsd-user/arm/target_arch_cpu.c | 2 ++ bsd-user/freebsd/os-sys.c | 1 + bsd-user/i386/signal.c | 1 + bsd-user/i386/target_arch_cpu.c | 3 +-- bsd-user/main.c | 4 +--- bsd-user/strace.c | 1 - bsd-user/x86_64/signal.c | 1 + bsd-user/x86_64/target_arch_cpu.c | 3 +-- hw/9pfs/9p.c | 5 ----- hw/acpi/piix4.c | 1 - hw/alpha/dp264.c | 1 - hw/arm/virt.c | 1 - hw/arm/xlnx-versal.c | 1 - hw/block/pflash_cfi01.c | 1 - hw/core/machine.c | 1 - hw/display/virtio-gpu-udmabuf.c | 1 - hw/hppa/machine.c | 1 - hw/hyperv/syndbg.c | 2 +- hw/i2c/pmbus_device.c | 1 - hw/i386/acpi-build.c | 1 - hw/input/tsc210x.c | 1 - hw/loongarch/acpi-build.c | 1 - hw/misc/macio/cuda.c | 1 - hw/misc/macio/pmu.c | 1 - hw/net/xilinx_axienet.c | 1 - hw/ppc/ppc405_uc.c | 2 -- hw/ppc/ppc440_bamboo.c | 1 - hw/ppc/spapr_drc.c | 1 - hw/rdma/vmw/pvrdma_dev_ring.c | 1 - hw/remote/machine.c | 1 - hw/remote/proxy-memory-listener.c | 1 - hw/remote/remote-obj.c | 1 - hw/rtc/mc146818rtc.c | 1 - hw/s390x/virtio-ccw-serial.c | 1 - hw/sensor/adm1272.c | 1 - hw/usb/dev-storage-bot.c | 1 - hw/usb/dev-storage-classic.c | 1 - migration/postcopy-ram.c | 2 -- qga/commands-posix.c | 1 - qga/cutils.c | 3 ++- softmmu/dirtylimit.c | 1 - softmmu/runstate.c | 1 - softmmu/vl.c | 3 --- target/loongarch/translate.c | 1 - target/mips/tcg/translate.c | 1 - target/nios2/translate.c | 2 -- tcg/tci.c | 1 - tests/unit/test-cutils.c | 1 - tests/unit/test-seccomp.c | 1 - ui/gtk.c | 1 - ui/udmabuf.c | 1 - util/async-teardown.c | 12 ++++-------- util/main-loop.c | 1 - util/oslib-posix.c | 6 ------ scripts/clean-includes | 15 ++++++++++----- 89 files changed, 29 insertions(+), 123 deletions(-)Signature · 1 line
2.39.0