From: Dave Jiang <dave.jiang@intel.com>
To: Erick Archer <erick.archer@outlook.com>,
Vishal Verma <vishal.l.verma@intel.com>,
Dan Williams <dan.j.williams@intel.com>,
Ira Weiny <ira.weiny@intel.com>,
Kees Cook <keescook@chromium.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
Justin Stitt <justinstitt@google.com>
Cc: nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org
Subject: Re: [PATCH] nvdimm/btt: use sizeof(*pointer) instead of sizeof(type)
Date: Thu, 6 Jun 2024 09:11:17 -0700 [thread overview]
Message-ID: <4dd8ebe0-868d-4125-ad23-c5a8b5249ce9@intel.com> (raw)
In-Reply-To: <AS8PR02MB72372490C53FB2E35DA1ADD08BFE2@AS8PR02MB7237.eurprd02.prod.outlook.com>
On 6/2/24 1:18 AM, Erick Archer wrote:
> It is preferred to use sizeof(*pointer) instead of sizeof(type)
> due to the type of the variable can change and one needs not
> change the former (unlike the latter). This patch has no effect
> on runtime behavior.
>
> Signed-off-by: Erick Archer <erick.archer@outlook.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> ---
> drivers/nvdimm/btt.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c
> index 1e5aedaf8c7b..b25df8fa8e8e 100644
> --- a/drivers/nvdimm/btt.c
> +++ b/drivers/nvdimm/btt.c
> @@ -751,7 +751,7 @@ static struct arena_info *alloc_arena(struct btt *btt, size_t size,
> u64 logsize, mapsize, datasize;
> u64 available = size;
>
> - arena = kzalloc(sizeof(struct arena_info), GFP_KERNEL);
> + arena = kzalloc(sizeof(*arena), GFP_KERNEL);
> if (!arena)
> return NULL;
> arena->nd_btt = btt->nd_btt;
> @@ -978,7 +978,7 @@ static int btt_arena_write_layout(struct arena_info *arena)
> if (ret)
> return ret;
>
> - super = kzalloc(sizeof(struct btt_sb), GFP_NOIO);
> + super = kzalloc(sizeof(*super), GFP_NOIO);
> if (!super)
> return -ENOMEM;
>
prev parent reply other threads:[~2024-06-06 16:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-02 8:18 Erick Archer
2024-06-06 16:11 ` Dave Jiang [this message]
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=4dd8ebe0-868d-4125-ad23-c5a8b5249ce9@intel.com \
--to=dave.jiang@intel.com \
--cc=dan.j.williams@intel.com \
--cc=erick.archer@outlook.com \
--cc=gustavoars@kernel.org \
--cc=ira.weiny@intel.com \
--cc=justinstitt@google.com \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
--cc=vishal.l.verma@intel.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
all inboxes | Powered by JetHome®