linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] move offsetofend() from vfio.h to stddef.h
@ 2015-03-09 14:52 Denys Vlasenko
  2015-03-09 14:52 ` [PATCH 2/2 v2] x86: make 32-bit "emergency stack" better documented Denys Vlasenko
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Denys Vlasenko @ 2015-03-09 14:52 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: Denys Vlasenko, Linus Torvalds, Steven Rostedt, Ingo Molnar,
	Borislav Petkov, H. Peter Anvin, Oleg Nesterov,
	Frederic Weisbecker, Alexei Starovoitov, Will Drewry, Kees Cook,
	x86, linux-kernel

Suggested by Linus.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
CC: Linus Torvalds <torvalds@linux-foundation.org>
CC: Steven Rostedt <rostedt@goodmis.org>
CC: Ingo Molnar <mingo@kernel.org>
CC: Borislav Petkov <bp@alien8.de>
CC: "H. Peter Anvin" <hpa@zytor.com>
CC: Andy Lutomirski <luto@amacapital.net>
CC: Oleg Nesterov <oleg@redhat.com>
CC: Frederic Weisbecker <fweisbec@gmail.com>
CC: Alexei Starovoitov <ast@plumgrid.com>
CC: Will Drewry <wad@chromium.org>
CC: Kees Cook <keescook@chromium.org>
CC: x86@kernel.org
CC: linux-kernel@vger.kernel.org
---
 include/linux/stddef.h |  9 +++++++++
 include/linux/vfio.h   | 13 -------------
 2 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/include/linux/stddef.h b/include/linux/stddef.h
index f4aec0e..076af43 100644
--- a/include/linux/stddef.h
+++ b/include/linux/stddef.h
@@ -19,3 +19,12 @@ enum {
 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
 #endif
 #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))
diff --git a/include/linux/vfio.h b/include/linux/vfio.h
index 2d67b89..049b2f4 100644
--- a/include/linux/vfio.h
+++ b/include/linux/vfio.h
@@ -78,19 +78,6 @@ extern int vfio_register_iommu_driver(const struct vfio_iommu_driver_ops *ops);
 extern void vfio_unregister_iommu_driver(
 				const struct vfio_iommu_driver_ops *ops);
 
-/**
- * offsetofend(TYPE, MEMBER)
- *
- * @TYPE: The type of the structure
- * @MEMBER: The member within the structure to get the end offset of
- *
- * Simple helper macro for dealing with variable sized structures passed
- * from user space.  This allows us to easily determine if the provided
- * structure is sized to include various fields.
- */
-#define offsetofend(TYPE, MEMBER) \
-	(offsetof(TYPE, MEMBER)	+ sizeof(((TYPE *)0)->MEMBER))
-
 /*
  * External user API
  */
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-03-17  8:47 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-09 14:52 [PATCH 1/2] move offsetofend() from vfio.h to stddef.h Denys Vlasenko
2015-03-09 14:52 ` [PATCH 2/2 v2] x86: make 32-bit "emergency stack" better documented Denys Vlasenko
2015-03-09 15:16   ` Andy Lutomirski
2015-03-14 16:00   ` Pavel Machek
2015-03-14 17:24     ` Brian Gerst
2015-03-16 12:10   ` [tip:x86/asm] x86/asm/entry/32: Document the 32-bit SYSENTER " emergency stack" better tip-bot for Denys Vlasenko
2015-03-17  8:46   ` tip-bot for Denys Vlasenko
2015-03-09 14:58 ` [PATCH 1/2] move offsetofend() from vfio.h to stddef.h Ingo Molnar
2015-03-09 15:15   ` Denys Vlasenko
2015-03-09 15:28     ` Ingo Molnar
2015-03-09 15:30       ` Andy Lutomirski
2015-03-09 15:45         ` Ingo Molnar
2015-03-09 15:44       ` Alex Williamson
2015-03-09 16:16 ` Linus Torvalds
2015-03-16 12:10 ` [tip:x86/asm] include/stddef.h: Move offsetofend() from vfio.h to a generic kernel header tip-bot for Denys Vlasenko
2015-03-17  8:46 ` tip-bot for Denys Vlasenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).