[PATCH 35/50] cpumask: Split out cpumask_types.h

From: Kent Overstreet
Date: Fri Dec 15 2023 - 22:34:52 EST


More sched.h dependency trimming: this will help to kill the printk.h
dependency.

Signed-off-by: Kent Overstreet <kent.overstreet@xxxxxxxxx>
---
arch/x86/include/asm/tlbbatch.h | 2 +-
include/linux/cpumask.h | 4 +---
include/linux/cpumask_types.h | 12 ++++++++++++
3 files changed, 14 insertions(+), 4 deletions(-)
create mode 100644 include/linux/cpumask_types.h

diff --git a/arch/x86/include/asm/tlbbatch.h b/arch/x86/include/asm/tlbbatch.h
index 1ad56eb3e8a8..0550dea70c0f 100644
--- a/arch/x86/include/asm/tlbbatch.h
+++ b/arch/x86/include/asm/tlbbatch.h
@@ -2,7 +2,7 @@
#ifndef _ARCH_X86_TLBBATCH_H
#define _ARCH_X86_TLBBATCH_H

-#include <linux/cpumask.h>
+#include <linux/cpumask_types.h>

struct arch_tlbflush_unmap_batch {
/*
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index cfb545841a2c..b710dc4cd858 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -14,9 +14,7 @@
#include <linux/bug.h>
#include <linux/gfp_types.h>
#include <linux/numa.h>
-
-/* Don't assign or return these: may not be this big! */
-typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t;
+#include <linux/cpumask_types.h>

/**
* cpumask_bits - get the bits in a cpumask
diff --git a/include/linux/cpumask_types.h b/include/linux/cpumask_types.h
new file mode 100644
index 000000000000..f4c032c9a81a
--- /dev/null
+++ b/include/linux/cpumask_types.h
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __LINUX_CPUMASK_TYPES_H
+#define __LINUX_CPUMASK_TYPES_H
+
+#include <linux/bitops.h>
+#include <linux/types.h>
+#include <linux/threads.h>
+
+/* Don't assign or return these: may not be this big! */
+typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t;
+
+#endif /* __LINUX_CPUMASK_TYPES_H */
--
2.43.0