summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx.manpages@gmail.com>2021-11-19 01:19:05 +0100
committerAlejandro Colomar <alx.manpages@gmail.com>2021-11-19 01:19:05 +0100
commit65b36e136a5a9bf7751e426cdc9fbd8255e7aaa1 (patch)
tree24c7f62ef1461e7fd941c4df670da81e1c9c3818
parent101897d6e63c3ce95661f5332a5df960db11ccac (diff)
linux/typeof_member.h: Move typeof_member() to a separate header
Touching files so used for the kernel, forces 'make' to recompile most of the kernel. Having those definitions in more granular files helps avoid recompiling so much of the kernel. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
-rw-r--r--drivers/gpu/drm/i915/i915_sw_fence.c1
-rw-r--r--drivers/platform/x86/wmi.c1
-rw-r--r--fs/proc/inode.c1
-rw-r--r--include/linux/container_of.h2
-rw-r--r--include/linux/typeof_member.h11
-rw-r--r--include/linux/virtio_config.h1
-rw-r--r--kernel/kallsyms.c1
7 files changed, 16 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_sw_fence.c b/drivers/gpu/drm/i915/i915_sw_fence.c
index c589a681da77..911ad08978b2 100644
--- a/drivers/gpu/drm/i915/i915_sw_fence.c
+++ b/drivers/gpu/drm/i915/i915_sw_fence.c
@@ -8,6 +8,7 @@
#include <linux/dma-fence.h>
#include <linux/irq_work.h>
#include <linux/dma-resv.h>
+#include <linux/typeof_member.h>
#include "i915_sw_fence.h"
#include "i915_selftest.h"
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index c34341f4da76..5daadcafd808 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -33,6 +33,7 @@
#include <linux/uuid.h>
#include <linux/wmi.h>
#include <linux/fs.h>
+#include <linux/typeof_member.h>
#include <uapi/linux/wmi.h>
MODULE_AUTHOR("Carlos Corbacho");
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 599eb724ff2d..e73e55e8dad4 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -25,6 +25,7 @@
#include <linux/slab.h>
#include <linux/mount.h>
#include <linux/bug.h>
+#include <linux/typeof_member.h>
#include <linux/uaccess.h>
diff --git a/include/linux/container_of.h b/include/linux/container_of.h
index 2f1eb5ddd20a..082188b5cd29 100644
--- a/include/linux/container_of.h
+++ b/include/linux/container_of.h
@@ -7,8 +7,6 @@
#include <linux/memberof.h>
-#define typeof_member(T, m) typeof(memberof(T, m))
-
/**
* container_of - cast a member of a structure out to the containing structure
* @ptr: the pointer to the member.
diff --git a/include/linux/typeof_member.h b/include/linux/typeof_member.h
new file mode 100644
index 000000000000..38aa030d86d2
--- /dev/null
+++ b/include/linux/typeof_member.h
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_TYPEOF_MEMBER_H
+#define _LINUX_TYPEOF_MEMBER_H
+
+#include <linux/memberof.h>
+
+
+#define typeof_member(T, m) typeof(memberof(T, m))
+
+
+#endif /* _LINUX_TYPEOF_MEMBER_H */
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
index ddbd51208ce1..ff1752441e5d 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -8,6 +8,7 @@
#include <linux/virtio.h>
#include <linux/virtio_byteorder.h>
#include <linux/compiler_types.h>
+#include <linux/typeof_member.h>
#include <uapi/linux/virtio_config.h>
struct irq_affinity;
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 3011bc33a5ba..3bf04d89d72c 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -29,6 +29,7 @@
#include <linux/compiler.h>
#include <linux/module.h>
#include <linux/kernel.h>
+#include <linux/typeof_member.h>
/*
* These will be re-linked against their real values