[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lsq.1519831222.933053267@decadent.org.uk>
Date: Wed, 28 Feb 2018 15:20:22 +0000
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org, "Steven Rostedt" <rostedt@...dmis.org>,
"Borislav Petkov" <bp@...en8.de>,
"Andy Lutomirski" <luto@...capital.net>,
"Linus Torvalds" <torvalds@...ux-foundation.org>,
"Oleg Nesterov" <oleg@...hat.com>,
"Will Drewry" <wad@...omium.org>,
"Denys Vlasenko" <dvlasenk@...hat.com>,
"Kees Cook" <keescook@...omium.org>,
"Frederic Weisbecker" <fweisbec@...il.com>,
"H. Peter Anvin" <hpa@...or.com>, "Ingo Molnar" <mingo@...nel.org>,
"Alexei Starovoitov" <ast@...mgrid.com>
Subject: [PATCH 3.2 069/140] include/stddef.h: Move offsetofend() from
vfio.h to a generic kernel header
3.2.100-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Denys Vlasenko <dvlasenk@...hat.com>
commit 3876488444e71238e287459c39d7692b6f718c3e upstream.
Suggested by Andy.
Suggested-by: Andy Lutomirski <luto@...capital.net>
Signed-off-by: Denys Vlasenko <dvlasenk@...hat.com>
Acked-by: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Alexei Starovoitov <ast@...mgrid.com>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Kees Cook <keescook@...omium.org>
Cc: Oleg Nesterov <oleg@...hat.com>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Will Drewry <wad@...omium.org>
Link: http://lkml.kernel.org/r/1425912738-559-1-git-send-email-dvlasenk@redhat.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
[bwh: Backported to 3.2:
- There is no definition in vfio.h to move
- Put the definition inside the #ifdef __KERNEL__ section]
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
--- a/include/linux/stddef.h
+++ b/include/linux/stddef.h
@@ -23,6 +23,16 @@ enum {
#else
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif
+
+/**
+ * offsetofend(TYPE, MEMBER)
+ *
+ * @TYPE: The type of the structure
+ * @MEMBER: The member within the structure to get the end offset of
+ */
+#define offsetofend(TYPE, MEMBER) \
+ (offsetof(TYPE, MEMBER) + sizeof(((TYPE *)0)->MEMBER))
+
#endif /* __KERNEL__ */
#endif
Powered by blists - more mailing lists