misc: Clean up includes

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
This commit is contained in:
Peter Maydell
2026-01-16 12:58:29 +00:00
parent 6b0d081e60
commit dc249aaf57
8 changed files with 0 additions and 8 deletions

View 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

View File

@@ -6,7 +6,6 @@
#include "qemu/osdep.h"
#include "semihosting/semihost.h"
#include <glib.h>
bool semihosting_arm_compatible(void)
{

View 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)
{

View 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>

View 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"

View 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)

View 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>

View 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