clang-tidy: Fix all remaining misc-include-cleaner violations

- Remove unused includes
- Add common false positive headers to misc-include-cleaner.IgnoreHeaders
- Add IWYU pragma keep for uncommon false positive headers
This commit is contained in:
Daan De Meyer
2025-11-22 10:19:41 +01:00
parent d11ce97386
commit 87fbd33372
123 changed files with 138 additions and 147 deletions
+4 -1
View File
@@ -1,9 +1,11 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "apparmor-setup.h"
#if HAVE_APPARMOR
#include <unistd.h>
#include "alloc-util.h"
#include "apparmor-setup.h"
#include "apparmor-util.h"
#include "errno-util.h"
#include "fd-util.h"
@@ -11,6 +13,7 @@
#include "log.h"
#include "string-util.h"
#include "strv.h"
#endif
int mac_apparmor_setup(void) {
#if HAVE_APPARMOR
+1 -1
View File
@@ -2,7 +2,7 @@
#include <fcntl.h>
#include <linux/auto_dev-ioctl.h>
#include <sys/mount.h>
#include <sys/mount.h> /* IWYU pragma: keep */
#include <sys/stat.h>
#include <unistd.h>
+2 -2
View File
@@ -7,11 +7,11 @@
* fine given that LGPL-2.1-or-later downgrades to GPL if needed.
*/
#include "bpf-dlopen.h"
#include "bpf-dlopen.h" /* IWYU pragma: keep */
/* libbpf is used via dlopen(), so rename symbols */
#define bpf_object__open_skeleton sym_bpf_object__open_skeleton
#define bpf_object__load_skeleton sym_bpf_object__load_skeleton
#define bpf_object__destroy_skeleton sym_bpf_object__destroy_skeleton
#include "bpf/restrict-fs/restrict-fs.skel.h"
#include "bpf/restrict-fs/restrict-fs.skel.h" /* IWYU pragma: export */
@@ -7,11 +7,11 @@
* fine given that LGPL-2.1-or-later downgrades to GPL if needed.
*/
#include "bpf-dlopen.h"
#include "bpf-dlopen.h" /* IWYU pragma: keep */
/* libbpf is used via dlopen(), so rename symbols */
#define bpf_object__open_skeleton sym_bpf_object__open_skeleton
#define bpf_object__load_skeleton sym_bpf_object__load_skeleton
#define bpf_object__destroy_skeleton sym_bpf_object__destroy_skeleton
#include "bpf/restrict-ifaces/restrict-ifaces.skel.h"
#include "bpf/restrict-ifaces/restrict-ifaces.skel.h" /* IWYU pragma: export */
+2 -2
View File
@@ -7,11 +7,11 @@
* fine given that LGPL-2.1-or-later downgrades to GPL if needed.
*/
#include "bpf-dlopen.h"
#include "bpf-dlopen.h" /* IWYU pragma: keep */
/* libbpf is used via dlopen(), so rename symbols */
#define bpf_object__open_skeleton sym_bpf_object__open_skeleton
#define bpf_object__load_skeleton sym_bpf_object__load_skeleton
#define bpf_object__destroy_skeleton sym_bpf_object__destroy_skeleton
#include "bpf/socket-bind/socket-bind.skel.h"
#include "bpf/socket-bind/socket-bind.skel.h" /* IWYU pragma: export */
-2
View File
@@ -51,10 +51,8 @@
#include "virt.h"
#if BPF_FRAMEWORK
#include "bpf-dlopen.h"
#include "bpf-link.h"
#include "bpf-restrict-fs.h"
#include "bpf/restrict-fs/restrict-fs-skel.h"
#endif
#define CGROUP_CPU_QUOTA_DEFAULT_PERIOD_USEC (100 * USEC_PER_MSEC)
+1 -1
View File
@@ -32,7 +32,7 @@
#include "special.h"
#include "string-util.h"
#include "strv.h"
#include "transaction.h"
#include "transaction.h" /* IWYU pragma: keep */
#include "unit-name.h"
#include "web-util.h"
+1 -1
View File
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-bus.h"
#include "sd-bus.h" /* IWYU pragma: keep */
#include "core-forward.h"
#include "string-util.h"
+1 -1
View File
@@ -22,12 +22,12 @@
#include "ordered-set.h"
#include "path-lookup.h"
#include "path-util.h"
#include "process-util.h"
#include "random-util.h"
#include "recurse-dir.h"
#include "rm-rf.h"
#include "siphash24.h"
#include "stat-util.h"
#include "string-util.h"
#include "strv.h"
#include "user-util.h"
+2 -2
View File
@@ -1,9 +1,9 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <grp.h>
#include <linux/sched.h>
#include <linux/securebits.h>
#include <poll.h>
#include <sched.h>
#include <sys/eventfd.h>
#include <sys/ioctl.h>
#include <sys/ioprio.h>
@@ -15,7 +15,7 @@
#include "sd-messages.h"
#include "apparmor-util.h"
#include "apparmor-util.h" /* IWYU pragma: keep */
#include "argv-util.h"
#include "ask-password-api.h"
#include "barrier.h"
-1
View File
@@ -6,7 +6,6 @@
#include "sd-id128.h"
#include "bus-unit-util.h"
#include "cgroup-util.h"
#include "core-forward.h"
#include "cpu-set-util.h"
#include "exec-util.h"
+1 -1
View File
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/audit.h>
#include <linux/audit.h> /* IWYU pragma: keep */
#include <math.h>
#include <sys/stat.h>
#include <unistd.h>
-1
View File
@@ -1,6 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <arpa/inet.h>
#include <fcntl.h>
#include <linux/sctp.h>
#include <mqueue.h>
-1
View File
@@ -11,7 +11,6 @@
#include "all-units.h"
#include "alloc-util.h"
#include "ansi-color.h"
#include "bpf-firewall.h"
#include "bpf-restrict-fs.h"
#include "bus-common-errors.h"
#include "bus-internal.h"
-1
View File
@@ -12,7 +12,6 @@
#include "json-util.h"
#include "manager.h"
#include "pidref.h"
#include "process-util.h"
#include "selinux-access.h"
#include "set.h"
#include "strv.h"
-1
View File
@@ -17,7 +17,6 @@
#include "strv.h"
#include "unit.h"
#include "varlink-cgroup.h"
#include "varlink-common.h"
#include "varlink-execute.h"
#include "varlink-unit.h"
#include "varlink-util.h"