From: Shyam Saini <shyam.saini@amarulasolutions.com>
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 <shyam.saini@amarulasolutions.com>
Subject: [PATCH 2/2] include: linux: Remove unused macros and their defination
Date: Sun, 14 Apr 2019 14:44:52 +0530 [thread overview]
Message-ID: <20190414091452.22275-2-shyam.saini@amarulasolutions.com> (raw)
In-Reply-To: <20190414091452.22275-1-shyam.saini@amarulasolutions.com>
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 <shyam.saini@amarulasolutions.com>
---
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
next prev parent reply other threads:[~2019-04-14 9:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-14 9:14 [PATCH 1/2] include: linux: Regularise the use of FIELD_SIZEOF macro Shyam Saini
2019-04-14 9:14 ` Shyam Saini [this message]
2019-04-15 5:43 ` Alexei Starovoitov
2019-04-15 7:13 ` Shyam Saini
2019-04-15 10:12 ` William Kucharski
2019-04-20 10:51 ` Shyam Saini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190414091452.22275-2-shyam.saini@amarulasolutions.com \
--to=shyam.saini@amarulasolutions.com \
--cc=akpm@linux-foundation.org \
--cc=bpf@vger.kernel.org \
--cc=devel@lists.orangefs.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-gvt-dev@lists.freedesktop.org \
--cc=keescook@chromium.org \
--cc=kernel-hardening@lists.openwall.com \
--cc=kvm@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-sctp@vger.kernel.org \
--cc=mayhs11saini@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox