[PATCH 5/5] stddef.h: Remove sizeof_field macro

From: Pankaj Bharadiya
Date: Tue Sep 24 2019 - 07:05:32 EST


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@xxxxxxxxx>
---
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