[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190529190720.GA5703@avx2>
Date: Wed, 29 May 2019 22:07:20 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: akpm@...ux-foundation.org
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] add typeof_member() macro
Add typeof_member() macro so that types can be exctracted without
introducing dummy variables.
Signed-off-by: Alexey Dobriyan <adobriyan@...il.com>
---
include/linux/kernel.h | 2 ++
1 file changed, 2 insertions(+)
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -88,6 +88,8 @@
*/
#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
+#define typeof_member(T, m) typeof(((T*)0)->m)
+
#define DIV_ROUND_UP __KERNEL_DIV_ROUND_UP
#define DIV_ROUND_DOWN_ULL(ll, d) \
Powered by blists - more mailing lists