From: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
To: pankaj.bharadiya@gmail.com, andriy.shevchenko@linux.intel.com,
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 16:21:14 +0530 [thread overview]
Message-ID: <20190924105114.110535-6-pankaj.laxminarayan.bharadiya@intel.com> (raw)
In-Reply-To: <20190924105114.110535-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 <pankaj.laxminarayan.bharadiya@intel.com>
---
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
--
2.17.1
next prev parent reply other threads:[~2019-09-24 11:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-24 10:51 [PATCH 0/5] Add and use sizeof_member macro to bring uniformity Pankaj Bharadiya
2019-09-24 10:51 ` [PATCH 1/5] linux/kernel.h: Add sizeof_member macro Pankaj Bharadiya
2019-09-24 10:51 ` [PATCH 2/5] treewide: Use " Pankaj Bharadiya
2019-09-24 10:51 ` [PATCH 3/5] MIPS: OCTEON: use sizeof_member macro instead of SIZEOF_FIELD Pankaj Bharadiya
2019-09-24 10:51 ` [PATCH 4/5] linux/kernel.h: Remove FIELD_SIZEOF macro Pankaj Bharadiya
2019-09-24 10:51 ` Pankaj Bharadiya [this message]
2019-09-24 13:02 ` [PATCH 0/5] Add and use sizeof_member macro to bring uniformity Bharadiya,Pankaj
-- strict thread matches above, loose matches on Subject: below --
2019-09-24 10:58 Pankaj Bharadiya
2019-09-24 10:58 ` [PATCH 5/5] stddef.h: Remove sizeof_field macro Pankaj Bharadiya
2019-09-24 8:14 [PATCH 0/5] Add and use sizeof_member macro to bring uniformity Pankaj Bharadiya
2019-09-24 8:14 ` [PATCH 5/5] stddef.h: Remove sizeof_field macro Pankaj Bharadiya
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=20190924105114.110535-6-pankaj.laxminarayan.bharadiya@intel.com \
--to=pankaj.laxminarayan.bharadiya@intel.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=keescook@chromium.org \
--cc=kernel-hardening@lists.openwall.com \
--cc=mayhs11saini@gmail.com \
--cc=pankaj.bharadiya@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).