| From | Alejandro Colomar <> | Subject | [PATCH v2 05/20] linux/container_of.h, linux/typeof_member.h: Split typeof_member() into a separate header | Date | Sat, 20 Nov 2021 14:00:48 +0100 |
| |
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
|