lkml.org 
[lkml]   [2021]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 05/20] linux/container_of.h, linux/typeof_member.h: Split typeof_member() into a separate header
Date
Include <linux/typeof_member.h> from <linux/container_of.h> for compatibility.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
include/linux/container_of.h | 3 ++-
include/linux/typeof_member.h | 9 +++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
create mode 100644 include/linux/typeof_member.h

diff --git a/include/linux/container_of.h b/include/linux/container_of.h
index 2f4944b791b8..220990db7b61 100644
--- a/include/linux/container_of.h
+++ b/include/linux/container_of.h
@@ -2,10 +2,11 @@
#ifndef _LINUX_CONTAINER_OF_H
#define _LINUX_CONTAINER_OF_H

+
#include <linux/build_bug.h>
#include <linux/err.h>
+#include <linux/typeof_member.h>

-#define typeof_member(T, m) typeof(((T*)0)->m)

/**
* container_of - cast a member of a structure out to the containing structure
diff --git a/include/linux/typeof_member.h b/include/linux/typeof_member.h
new file mode 100644
index 000000000000..1f3bfb3c17d2
--- /dev/null
+++ b/include/linux/typeof_member.h
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_TYPEOF_MEMBER_H
+#define _LINUX_TYPEOF_MEMBER_H
+
+
+#define typeof_member(T, m) typeof(((T *)0)->m)
+
+
+#endif /* _LINUX_TYPEOF_MEMBER_H */
--
2.33.1
\
 
 \ /
  Last update: 2021-11-20 14:03    [W:0.425 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site