All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
To: kernel-hardening@lists.openwall.com, keescook@chromium.org,
	akpm@linux-foundation.org, mayhs11saini@gmail.com
Cc: pankaj.laxminarayan.bharadiya@intel.com
Subject: [PATCH 3/5] MIPS: OCTEON: use sizeof_member macro instead of SIZEOF_FIELD
Date: Tue, 24 Sep 2019 13:44:37 +0530	[thread overview]
Message-ID: <20190924081439.15219-4-pankaj.laxminarayan.bharadiya@intel.com> (raw)
In-Reply-To: <20190924081439.15219-1-pankaj.laxminarayan.bharadiya@intel.com>

Now we have a standard sizeof_member macro to find the size of a
member of a struct. Remove the SIZEOF_FIELD macro and use
sizeof_member instead.

Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
---
 arch/mips/cavium-octeon/executive/cvmx-bootmem.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/arch/mips/cavium-octeon/executive/cvmx-bootmem.c b/arch/mips/cavium-octeon/executive/cvmx-bootmem.c
index ba8f82a29a81..c2cbb6ca29f9 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-bootmem.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-bootmem.c
@@ -44,13 +44,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
@@ -65,7 +58,7 @@ static struct cvmx_bootmem_desc *cvmx_bootmem_desc;
 #define CVMX_BOOTMEM_NAMED_GET_FIELD(addr, field)			\
 	__cvmx_bootmem_desc_get(addr,					\
 		offsetof(struct cvmx_bootmem_named_block_desc, field),	\
-		SIZEOF_FIELD(struct cvmx_bootmem_named_block_desc, field))
+		sizeof_member(struct cvmx_bootmem_named_block_desc, field))
 
 /**
  * This function is the implementation of the get macros defined
-- 
2.17.1


  parent reply	other threads:[~2019-09-24 11:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 1/5] linux/kernel.h: Add sizeof_member macro Pankaj Bharadiya
2019-09-24  8:14 ` [PATCH 2/5] treewide: Use " Pankaj Bharadiya
2019-09-24  8:14 ` Pankaj Bharadiya [this message]
2019-09-24  8:14 ` [PATCH 4/5] linux/kernel.h: Remove FIELD_SIZEOF macro Pankaj Bharadiya
2019-09-24  8:14 ` [PATCH 5/5] stddef.h: Remove sizeof_field macro Pankaj Bharadiya
2019-09-24 13:00 ` [PATCH 0/5] Add and use sizeof_member macro to bring uniformity Bharadiya,Pankaj
2019-09-24 10:51 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:58 [PATCH 0/5] Add and use sizeof_member macro to bring uniformity Pankaj Bharadiya
2019-09-24 10:58 ` [PATCH 3/5] MIPS: OCTEON: use sizeof_member macro instead of SIZEOF_FIELD 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=20190924081439.15219-4-pankaj.laxminarayan.bharadiya@intel.com \
    --to=pankaj.laxminarayan.bharadiya@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=mayhs11saini@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.