From patchwork Tue Sep 24 08:14:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Bharadiya X-Patchwork-Id: 11158443 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 75EAD1747 for ; Tue, 24 Sep 2019 11:10:09 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id D19912146E for ; Tue, 24 Sep 2019 11:10:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D19912146E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-16913-patchwork-kernel-hardening=patchwork.kernel.org@lists.openwall.com Received: (qmail 21579 invoked by uid 550); 24 Sep 2019 11:09:41 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Delivered-To: moderator for kernel-hardening@lists.openwall.com Received: (qmail 7637 invoked from network); 24 Sep 2019 08:21:16 -0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,543,1559545200"; d="scan'208";a="203330051" From: Pankaj Bharadiya To: kernel-hardening@lists.openwall.com, keescook@chromium.org, akpm@linux-foundation.org, mayhs11saini@gmail.com Cc: pankaj.laxminarayan.bharadiya@intel.com Subject: [PATCH 5/5] stddef.h: Remove sizeof_field macro Date: Tue, 24 Sep 2019 13:44:39 +0530 Message-Id: <20190924081439.15219-6-pankaj.laxminarayan.bharadiya@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190924081439.15219-1-pankaj.laxminarayan.bharadiya@intel.com> References: <20190924081439.15219-1-pankaj.laxminarayan.bharadiya@intel.com> Now we have sizeof_member macro to find the size of a member of a struct. sizeof_field macro is not getting used any more hence remove it. Also modify the offsetofend macro to get rid of it. Signed-off-by: Pankaj Bharadiya --- include/linux/stddef.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/include/linux/stddef.h b/include/linux/stddef.h index 998a4ba28eba..2181719fd907 100644 --- a/include/linux/stddef.h +++ b/include/linux/stddef.h @@ -19,14 +19,6 @@ enum { #define offsetof(TYPE, MEMBER) ((size_t)&((TYPE *)0)->MEMBER) #endif -/** - * sizeof_field(TYPE, MEMBER) - * - * @TYPE: The structure containing the field of interest - * @MEMBER: The field to return the size of - */ -#define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER)) - /** * offsetofend(TYPE, MEMBER) * @@ -34,6 +26,6 @@ enum { * @MEMBER: The member within the structure to get the end offset of */ #define offsetofend(TYPE, MEMBER) \ - (offsetof(TYPE, MEMBER) + sizeof_field(TYPE, MEMBER)) + (offsetof(TYPE, MEMBER) + sizeof(((TYPE *)0)->MEMBER)) #endif