[PATCH] fpga: dfl: afu: use kzalloc_obj over kzalloc with sizeof

From: Mayur Kumar

Date: Mon May 11 2026 - 14:24:55 EST


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