[PATCH] staging: nvec: Use kzalloc_obj instead of kzalloc
From: Samyak
Date: Sun Feb 15 2026 - 07:29:49 EST
From: Samyak Bambole <samyak.bambole07@xxxxxxxxx>
Replace kzalloc(sizeof(*ptr), GFP_KERNEL) with kzalloc_obj(*ptr,
GFP_KERNEL)
This addresses the following scripts/checkpatch.ph warning:
WARNING: Prefer kzalloc_obj over kzalloc with sizeof
Signed-off-by: Samyak Bambole <samyak.bambole07@xxxxxxxxx>
---
drivers/staging/nvec/nvec_ps2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/nvec/nvec_ps2.c b/drivers/staging/nvec/nvec_ps2.c
index 2db57795ea2f..3422a5213803 100644
--- a/drivers/staging/nvec/nvec_ps2.c
+++ b/drivers/staging/nvec/nvec_ps2.c
@@ -102,7 +102,7 @@ static int nvec_mouse_probe(struct platform_device *pdev)
struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent);
struct serio *ser_dev;
- ser_dev = kzalloc(sizeof(*ser_dev), GFP_KERNEL);
+ ser_dev = kzalloc_obj(*ser_dev, GFP_KERNEL);
if (!ser_dev)
return -ENOMEM;
--
2.53.0