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
#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
#include "qemu/osdep.h"
#include "semihosting/semihost.h"
-#include <glib.h>
bool semihosting_arm_compatible(void)
{
#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)
{
#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>
/*
* Copyright (c) 2025 Loongson Technology Corporation Limited
*/
-#include <stddef.h>
#include "qemu/osdep.h"
#include "cpu.h"
#include "csr.h"
#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)
#include "qemu/osdep.h"
#include <getopt.h>
-#include <stdbool.h>
#include <sys/ioctl.h>
#ifdef CONFIG_LIBCAP_NG
#include <cap-ng.h>
#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