Received: by 10.223.185.116 with SMTP id b49csp6369005wrg; Wed, 28 Feb 2018 08:16:59 -0800 (PST) X-Google-Smtp-Source: AH8x226qzfzWtVaTv82CYATBkWOsuEBeeJqi9CGb5IpY3UtVdHRdYBZKW+fTzTFtmqow0KLnm0vB X-Received: by 2002:a17:902:6b43:: with SMTP id g3-v6mr18210736plt.177.1519834619754; Wed, 28 Feb 2018 08:16:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519834619; cv=none; d=google.com; s=arc-20160816; b=SR03nmqOn7Z6jZ0Go5W8HCf4kAjLn6nPmNXdh9/g2eO2lCRrVf4dYjwl7DDIwBiuXi k9I+DOSreAjpIYHkL6Ir5XHy4Qz8N5x9ipFxrq9mMDyPUInvko7EVmdOgkKVbSRFoPw2 30RzGUkrWwAAhPo9DMdvCjsSTtR1ueZ5Dl0UMOlsLzCkoHoOlFKpDOuaHCNGBwjAyu9v F29YjUtC/P8ef7c1cPRsLPfrj/ioxDgyyk13x8BAY5PpT3Fhih+anZEDPjoIyl8zk6mm YJ9bUkR+eZ32Bi4rM1f/wazVzJ5edU/ZQs9sv4zjoWzgHOXVryapZsnTzzLuNrjWXA7w ewRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=s59l1YlcE8nRAq+R8HgFa1yi9iRSGsPUGFgBHLxpc/k=; b=m9wayrlJtxFqpybH3jb+k64t2n1UNkqwg8n927ACrU9dAePrWOaSz29BS9HbwAi1lR BflwHGaNludpX6UumZKZOKF6+njgoa4MNP9o/FgyMIc8u5eZaGdO20hKeapiqpJWI/yO uJX8Goa4pUFDWzuvzJEoTXAtpWiQpDgAlVa8V8Zn5gZF6WL213mTmToIF/+0augUCelu W3tYgqtXqCZGTai3SkPV4ZjAPToQUIZWEC3whs/OYtjTPlbG8GpqIjc8x85kzXZ2Vb2Y h+6CIqFu7ULd7yHmliGz+1i8+PChQZdrAiQ2sF9UmnrRydnvPbeuTT9wBAqhfrumB7Cy XhSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n18si1415833pfj.58.2018.02.28.08.16.45; Wed, 28 Feb 2018 08:16:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934953AbeB1QQO (ORCPT + 99 others); Wed, 28 Feb 2018 11:16:14 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:35226 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934923AbeB1QQL (ORCPT ); Wed, 28 Feb 2018 11:16:11 -0500 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1er3Yr-0006Xe-Kx; Wed, 28 Feb 2018 15:22:29 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1er3Yh-0000AD-VV; Wed, 28 Feb 2018 15:22:19 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Denys Vlasenko" , "Kees Cook" , "Frederic Weisbecker" , "Will Drewry" , "H. Peter Anvin" , "Borislav Petkov" , "Linus Torvalds" , "Alexei Starovoitov" , "Andy Lutomirski" , "Ingo Molnar" , "Oleg Nesterov" , "Steven Rostedt" Date: Wed, 28 Feb 2018 15:20:18 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 148/254] include/stddef.h: Move offsetofend() from vfio.h to a generic kernel header In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.55-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Denys Vlasenko commit 3876488444e71238e287459c39d7692b6f718c3e upstream. 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 Signed-off-by: Ben Hutchings --- include/linux/stddef.h | 9 +++++++++ include/linux/vfio.h | 13 ------------- 2 files changed, 9 insertions(+), 13 deletions(-) --- 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)) --- a/include/linux/vfio.h +++ b/include/linux/vfio.h @@ -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 */