Skip to contentSkip to conversation

Patch "include/stddef.h: Move offsetofend() from vfio.h to a generic kernel header" has been added to the 3.18-stable tree

PATCH [email protected] 1 participant 1 message Jul 22, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

include/stddef.h: Move offsetofend() from vfio.h to a generic kernel header

to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
include-stddef.h-move-offsetofend-from-vfio.h-to-a-generic-kernel-header.patch
and it can be found in the queue-3.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 3876488444e71238e287459c39d7692b6f718c3e Mon Sep 17 00:00:00 2001

From: Denys Vlasenko <[email protected]>
Date: Mon, 9 Mar 2015 15:52:17 +0100
Subject: include/stddef.h: Move offsetofend() from vfio.h to a generic kernel header

From: Denys Vlasenko <[email protected]>

commit 3876488444e71238e287459c39d7692b6f718c3e upstream.

Suggested by Andy.

---
 include/linux/stddef.h |    9 +++++++++
 include/linux/vfio.h   |   13 -------------
 2 files changed, 9 insertions(+), 13 deletions(-)
include/linux/stddef.h +9 -0
@@ -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))
include/linux/vfio.h +0 -13
@@ -76,19 +76,6 @@ extern int vfio_register_iommu_driver(co
 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
  */

Patches currently in stable-queue which might be from [email protected] are

queue-3.18/stddef.h-move-offsetofend-inside-ifndef-endif-guard-neaten.patch queue-3.18/include-stddef.h-move-offsetofend-from-vfio.h-to-a-generic-kernel-header.patch