]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
misc: Clean up includes
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 16 Jan 2026 12:58:29 +0000 (12:58 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 22 Jan 2026 11:23:31 +0000 (11:23 +0000)
This commit deals with various .c files that included system
headers that are already pulled in by osdep.h, where the .c
file includes osdep.h already itself.

This commit was created with scripts/clean-includes:
 ./scripts/clean-includes '--git' 'misc' 'hw/core' 'semihosting' 'target/arm' 'target/i386/kvm/kvm.c' 'target/loongarch' 'target/riscv' 'tools' 'util'

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

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

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260116125830.926296-4-peter.maydell@linaro.org

hw/core/machine-qmp-cmds.c
semihosting/arm-compat-semi-stub.c
target/arm/cpu32-stubs.c
target/i386/kvm/kvm.c
target/loongarch/csr.c
target/riscv/csr.c
tools/i386/qemu-vmsr-helper.c
util/cpuinfo-aarch64.c

index 79cbcdd63e8c1bdc63a02201f13add370f586d44..e62cb4ec888e8d356e469fe83160bd240f2741f4 100644 (file)
@@ -30,7 +30,6 @@
 #include "system/runstate.h"
 #include "system/system.h"
 #include "hw/s390x/storage-keys.h"
-#include <sys/stat.h>
 
 /*
  * QMP query for enabled and present accelerators
index bfa3681e2676dcdd4ad11283979cfe53eda4dd4a..40199c984297422d13db9642f9daecb4463d585b 100644 (file)
@@ -6,7 +6,6 @@
 
 #include "qemu/osdep.h"
 #include "semihosting/semihost.h"
-#include <glib.h>
 
 bool semihosting_arm_compatible(void)
 {
index f0ce1595725a83a254656f503d34bc72b1ea2c8a..9e50bb1b0b552f7813e7076fb1e1120cf9336b40 100644 (file)
@@ -3,7 +3,6 @@
 #include "qemu/osdep.h"
 #include "target/arm/cpu.h"
 #include "target/arm/internals.h"
-#include <glib.h>
 
 void arm_cpu_sme_finalize(ARMCPU *cpu, Error **errp)
 {
index 7b9b740a8e5a56bdf2f4b37752b2e0a2115a0443..0c940d4b640c09f800c148a6edab7d180dbd8662 100644 (file)
@@ -21,7 +21,6 @@
 #include <sys/utsname.h>
 #include <sys/syscall.h>
 #include <sys/resource.h>
-#include <sys/time.h>
 
 #include <linux/kvm.h>
 #include <linux/kvm_para.h>
index 332a1396cc21aaa99f628e2c73908a6d5af0e595..fff2312f87f11cd37a68f0ad782263ceb7db7b57 100644 (file)
@@ -2,7 +2,6 @@
 /*
  * Copyright (c) 2025 Loongson Technology Corporation Limited
  */
-#include <stddef.h>
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "csr.h"
index 05c7ec83529530a53ccbbeab50b531d41740b218..506448391715c4373d8db4df9902b908a45c8244 100644 (file)
@@ -31,7 +31,6 @@
 #include "qapi/error.h"
 #include "tcg/insn-start-words.h"
 #include "internals.h"
-#include <stdbool.h>
 
 /* CSR function table public API */
 void riscv_get_csr_ops(int csrno, riscv_csr_operations *ops)
index 6c0f4fe870e96742cbdbf32d532630304ab5c254..f12fd3c3e8169622a6c6538619c98ab5a54e2b49 100644 (file)
@@ -20,7 +20,6 @@
 
 #include "qemu/osdep.h"
 #include <getopt.h>
-#include <stdbool.h>
 #include <sys/ioctl.h>
 #ifdef CONFIG_LIBCAP_NG
 #include <cap-ng.h>
index 57468890c33800147c0af70058366e007012dcd7..288074c08f6e778b33eb123ae0a26d7e916c39db 100644 (file)
@@ -26,7 +26,6 @@
 #if defined(__OpenBSD__) && !defined(CONFIG_ELF_AUX_INFO)
 # include <machine/armreg.h>
 # include <machine/cpu.h>
-# include <sys/types.h>
 # include <sys/sysctl.h>
 #endif