[PATCH v2 14/20] linux/compiler_types.h, linux/same_type.h: Split __same_type() to a separate header

From: Alejandro Colomar
Date: Sat Nov 20 2021 - 08:01:55 EST


Include <linux/same_type.h> from <linux/compiler_types.h> for compatibility.

Signed-off-by: Alejandro Colomar <alx.manpages@xxxxxxxxx>
---
include/linux/compiler_types.h | 7 ++++---
include/linux/same_type.h | 10 ++++++++++
2 files changed, 14 insertions(+), 3 deletions(-)
create mode 100644 include/linux/same_type.h

diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h
index 1d32f4c03c9e..5a1626e2d331 100644
--- a/include/linux/compiler_types.h
+++ b/include/linux/compiler_types.h
@@ -2,6 +2,10 @@
#ifndef __LINUX_COMPILER_TYPES_H
#define __LINUX_COMPILER_TYPES_H

+
+#include <linux/same_type.h>
+
+
#ifndef __ASSEMBLY__

#ifdef __CHECKER__
@@ -272,9 +276,6 @@ struct ftrace_likely_data {
#define asm_inline asm
#endif

-/* Are two types/vars the same type (ignoring qualifiers)? */
-#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
-
/*
* __unqual_scalar_typeof(x) - Declare an unqualified scalar type, leaving
* non-scalar types unchanged.
diff --git a/include/linux/same_type.h b/include/linux/same_type.h
new file mode 100644
index 000000000000..2e45edda6d31
--- /dev/null
+++ b/include/linux/same_type.h
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __LINUX_SAME_TYPE_H
+#define __LINUX_SAME_TYPE_H
+
+
+/* Are two types/vars the same type (ignoring qualifiers)? */
+#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
+
+
+#endif /* __LINUX_SAME_TYPE_H */
--
2.33.1