From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751450AbbCPMKr (ORCPT ); Mon, 16 Mar 2015 08:10:47 -0400 Received: from terminus.zytor.com ([198.137.202.10]:36085 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750972AbbCPMKp (ORCPT ); Mon, 16 Mar 2015 08:10:45 -0400 Date: Mon, 16 Mar 2015 05:10:07 -0700 From: tip-bot for Denys Vlasenko Message-ID: Cc: bp@alien8.de, ast@plumgrid.com, keescook@chromium.org, wad@chromium.org, rostedt@goodmis.org, luto@amacapital.net, linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@zytor.com, mingo@kernel.org, torvalds@linux-foundation.org, dvlasenk@redhat.com, oleg@redhat.com, fweisbec@gmail.com Reply-To: bp@alien8.de, ast@plumgrid.com, keescook@chromium.org, wad@chromium.org, luto@amacapital.net, rostedt@goodmis.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@zytor.com, mingo@kernel.org, torvalds@linux-foundation.org, dvlasenk@redhat.com, oleg@redhat.com, fweisbec@gmail.com In-Reply-To: <1425912738-559-1-git-send-email-dvlasenk@redhat.com> References: <1425912738-559-1-git-send-email-dvlasenk@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] include/stddef.h: Move offsetofend() from vfio.h to a generic kernel header Git-Commit-ID: 23ec13ebc0426fc5f3ecc623c432d57f919e1b28 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 23ec13ebc0426fc5f3ecc623c432d57f919e1b28 Gitweb: http://git.kernel.org/tip/23ec13ebc0426fc5f3ecc623c432d57f919e1b28 Author: Denys Vlasenko AuthorDate: Mon, 9 Mar 2015 15:52:17 +0100 Committer: Ingo Molnar CommitDate: Mon, 16 Mar 2015 11:05:37 +0100 include/stddef.h: Move offsetofend() from vfio.h to a generic kernel header Suggested by Andy. Suggested-by: Andy Lutomirski Signed-off-by: Denys Vlasenko Acked-by: Linus Torvalds Cc: Alexei Starovoitov Cc: Borislav Petkov Cc: Frederic Weisbecker Cc: H. Peter Anvin Cc: Kees Cook Cc: Oleg Nesterov Cc: Steven Rostedt Cc: Will Drewry Link: http://lkml.kernel.org/r/1425912738-559-1-git-send-email-dvlasenk@redhat.com Signed-off-by: Ingo Molnar --- 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 */