The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] fpga: dfl: afu: use kzalloc_obj over kzalloc with sizeof
@ 2026-05-11 18:12 Mayur Kumar
  0 siblings, 0 replies; only message in thread
From: Mayur Kumar @ 2026-05-11 18:12 UTC (permalink / raw)
  To: yilun.xu, mdf; +Cc: trix, linux-fpga, linux-kernel, Mayur Kumar

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-11 18:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-11 18:12 [PATCH] fpga: dfl: afu: use kzalloc_obj over kzalloc with sizeof Mayur Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox