From: Mayur Kumar <kmayur809@gmail.com>
To: yilun.xu@intel.com, mdf@kernel.org
Cc: trix@redhat.com, linux-fpga@vger.kernel.org,
linux-kernel@vger.kernel.org, Mayur Kumar <kmayur809@gmail.com>
Subject: [PATCH] fpga: dfl: afu: use kzalloc_obj over kzalloc with sizeof
Date: Mon, 11 May 2026 23:42:40 +0530 [thread overview]
Message-ID: <20260511181240.223224-1-kmayur809@gmail.com> (raw)
The checkpatch tool prefers the use of kzalloc_obj() as it provides
better type safety and conciseness compared to kzalloc() with
an explicit sizeof().
Signed-off-by: Mayur Kumar <kmayur809@gmail.com>
---
drivers/fpga/dfl-afu-dma-region.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/fpga/dfl-afu-dma-region.c b/drivers/fpga/dfl-afu-dma-region.c
index 87652d58d03..8a9d705ebe3 100644
--- a/drivers/fpga/dfl-afu-dma-region.c
+++ b/drivers/fpga/dfl-afu-dma-region.c
@@ -316,7 +316,7 @@ int afu_dma_map_region(struct dfl_feature_dev_data *fdata,
if (user_addr + length < user_addr)
return -EINVAL;
- region = kzalloc(sizeof(*region), GFP_KERNEL);
+ region = kzalloc_obj(region, GFP_KERNEL);
if (!region)
return -ENOMEM;
--
2.34.1
reply other threads:[~2026-05-11 18:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260511181240.223224-1-kmayur809@gmail.com \
--to=kmayur809@gmail.com \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mdf@kernel.org \
--cc=trix@redhat.com \
--cc=yilun.xu@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