public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] staging: nvec: Use kzalloc_obj instead of kzalloc
@ 2026-02-15 12:29 Samyak
  2026-02-16  2:50 ` kernel test robot
  2026-02-16  8:14 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Samyak @ 2026-02-15 12:29 UTC (permalink / raw)
  To: marvin24
  Cc: gregkh, ac100, linux-tegra, linux-staging, linux-kernel,
	Samyak Bambole

From: Samyak Bambole <samyak.bambole07@gmail.com>

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@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-02-16  8:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-15 12:29 [PATCH] staging: nvec: Use kzalloc_obj instead of kzalloc Samyak
2026-02-16  2:50 ` kernel test robot
2026-02-16  8:14 ` kernel test robot

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