Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1161027yba; Sun, 14 Apr 2019 02:17:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJ3WWZPVLkCM3g5sGNOpuIz5B7peNXlW3YcE1Je+kiIlHumS3toSKjxJjaD7bEL3qtxOwX X-Received: by 2002:a63:2bc8:: with SMTP id r191mr64474718pgr.72.1555233473298; Sun, 14 Apr 2019 02:17:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555233473; cv=none; d=google.com; s=arc-20160816; b=dELDEkbYXPvin1LzJKbabn7P68NVSA89i6EzR//DvHkiF5EVDNKuoVrutTS1mIpUK+ D9jH7xeJ2KnIsb2fJSu19JZdlI49ZsC/BGmorlIff96lvmiX8T//e5bhMJNT+LT31IYg P7Bo3OIMOb298WUW+bFlt+9qqzpC2MmE/FcetoHw7WPJ4KGZZYGJBCPxbSfha4xxEUP5 uTrr3RNkSXN2X7d1LC13T+8fGHqGz2rsMbdq8T5bJkM6wzaNzoIRduMaPLfs3ewZWdZh vpCfI8gdN/okADS+QEhAebEtpW3EoGnCkFGNWe49Yp3iYhDL9VNH22ehGFaFjPL+Zgev px3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=nQJrrbue7c3N84Cd6mFZPA1Y1o7acbXS4cTb2nznlGA=; b=F/+KC35Cs5+OJQqm71BdgfqJg3zx+ecnGdYUCPjRIO51qq5yuwoIRJ9PZC1NtXZD3W 4K7lOpfc0aSjVJQlRf9+eq0bMuT8jz5yoKa1DwVyus551zWHpzfayGCT29BR3x+UO33M jdILsC4KmDiNcpuwc4zv/ADTVHqrBxLDu096JZd0+3q8PXP2KH09V9txfkz6bNquWXG/ W2KGyIrOMYtrifZhC0TXNufeanOpRxZ4BhcnPivSM4ul86wgt1cSe4tUaG94mTUXpMCn JL2gLxrn3NN/Yl7MuiliFIY8CSDfeoWxvszYqdoY0OrHxpvwartbdl2jHPCiF0YEONv+ ZUsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Vx6SC+WB; 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 h26si41711487pgl.21.2019.04.14.02.17.12; Sun, 14 Apr 2019 02:17:53 -0700 (PDT) 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; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Vx6SC+WB; 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 S1726835AbfDNJPh (ORCPT + 99 others); Sun, 14 Apr 2019 05:15:37 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:43166 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726598AbfDNJPg (ORCPT ); Sun, 14 Apr 2019 05:15:36 -0400 Received: by mail-pg1-f196.google.com with SMTP id z9so7161259pgu.10 for ; Sun, 14 Apr 2019 02:15:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nQJrrbue7c3N84Cd6mFZPA1Y1o7acbXS4cTb2nznlGA=; b=Vx6SC+WBX6kmXBT4OP7H4eDk8pZHoU/6bnBya6zmdqnkmojK/Kyegi8oINArN7IYSn +1/yKPRCgEiPL2mbV0UVrKN/5WOq6lk9U0eM7lknJ/LesMvOvavOIaIHTDuaUm2Sal0B 6L2RJwK2Dz0nII5LmzT4mcUBTnjEOkw+KlIkA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nQJrrbue7c3N84Cd6mFZPA1Y1o7acbXS4cTb2nznlGA=; b=hbeMorxABLaM73PbFcRcOdKanQtXiinTXqQR93POaThShdSxQUPIzgMxAMbQjc/mW6 yZupMHESL9X1b7m93cDHdKaxyyqRAuNSrA718upVBCBwqf/BJ5L0kluir5jCddIaBAMW pTn44rTiF0XAaFI8LgVWCvz4fv4yxXJn6c1SvsFNQxAGAzo2mp4YKtZ7orPz2VWvMu8H 5UCN9ICYuomUMPMMBWeON0UMUub38Q9CnTBimzApefFeHpWs3LEMOYPD8rFRqyYxWa0U OymMhLIVMwEDiB8wzqAmv1rqeaJCDfOXXnWNjyZ+YDtZ+FZQLKmRJ1J9XUDKOi/2km1w ifhw== X-Gm-Message-State: APjAAAUyOZO0PnKDHehm8hXl076OHDRWFD1sfvCW0GnqsbSPgTa/sgqk Y904x2h9nXIHnOMH8h/nF93C/A== X-Received: by 2002:a63:3188:: with SMTP id x130mr61423347pgx.64.1555233335889; Sun, 14 Apr 2019 02:15:35 -0700 (PDT) Received: from localhost.localdomain ([42.111.19.105]) by smtp.googlemail.com with ESMTPSA id g10sm31344767pgq.54.2019.04.14.02.15.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Apr 2019 02:15:35 -0700 (PDT) From: Shyam Saini To: kernel-hardening@lists.openwall.com Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, keescook@chromium.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, netdev@vger.kernel.org, linux-ext4@vger.kernel.org, devel@lists.orangefs.org, linux-mm@kvack.org, linux-sctp@vger.kernel.org, bpf@vger.kernel.org, kvm@vger.kernel.org, mayhs11saini@gmail.com, Shyam Saini Subject: [PATCH 2/2] include: linux: Remove unused macros and their defination Date: Sun, 14 Apr 2019 14:44:52 +0530 Message-Id: <20190414091452.22275-2-shyam.saini@amarulasolutions.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190414091452.22275-1-shyam.saini@amarulasolutions.com> References: <20190414091452.22275-1-shyam.saini@amarulasolutions.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In favour of FIELD_SIZEOF, lets deprecate other two similar macros sizeof_field and SIZEOF_FIELD, and remove them completely. Signed-off-by: Shyam Saini --- arch/mips/cavium-octeon/executive/cvmx-bootmem.c | 7 ------- include/linux/stddef.h | 8 -------- tools/testing/selftests/bpf/bpf_util.h | 4 ---- 3 files changed, 19 deletions(-) diff --git a/arch/mips/cavium-octeon/executive/cvmx-bootmem.c b/arch/mips/cavium-octeon/executive/cvmx-bootmem.c index fc754d155002..44b506a14666 100644 --- a/arch/mips/cavium-octeon/executive/cvmx-bootmem.c +++ b/arch/mips/cavium-octeon/executive/cvmx-bootmem.c @@ -45,13 +45,6 @@ static struct cvmx_bootmem_desc *cvmx_bootmem_desc; /* See header file for descriptions of functions */ /** - * This macro returns the size of a member of a structure. - * Logically it is the same as "sizeof(s::field)" in C++, but - * C lacks the "::" operator. - */ -#define SIZEOF_FIELD(s, field) sizeof(((s *)NULL)->field) - -/** * This macro returns a member of the * cvmx_bootmem_named_block_desc_t structure. These members can't * be directly addressed as they might be in memory not directly diff --git a/include/linux/stddef.h b/include/linux/stddef.h index 63f2302bc406..b888eb7795a1 100644 --- a/include/linux/stddef.h +++ b/include/linux/stddef.h @@ -29,14 +29,6 @@ enum { #define FIELD_SIZEOF(t, f) (sizeof(((t *)0)->f)) /** - * 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) * * @TYPE: The type of the structure diff --git a/tools/testing/selftests/bpf/bpf_util.h b/tools/testing/selftests/bpf/bpf_util.h index 2e90a4315b55..815e7b48fa37 100644 --- a/tools/testing/selftests/bpf/bpf_util.h +++ b/tools/testing/selftests/bpf/bpf_util.h @@ -67,10 +67,6 @@ static inline unsigned int bpf_num_possible_cpus(void) */ #define FIELD_SIZEOF(t, f) (sizeof(((t *)0)->f)) -#ifndef sizeof_field -#define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER)) -#endif - #ifndef offsetofend #define offsetofend(TYPE, MEMBER) \ (offsetof(TYPE, MEMBER) + FIELD_SIZEOF(TYPE, MEMBER)) -- 2.11.0