From: Samyak <samyak.bambole07@gmail.com>
To: marvin24@gmx.de
Cc: gregkh@linuxfoundation.org, ac100@lists.launchpad.net,
linux-tegra@vger.kernel.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org,
Samyak Bambole <samyak.bambole07@gmail.com>
Subject: [PATCH] staging: nvec: Use kzalloc_obj instead of kzalloc
Date: Sun, 15 Feb 2026 17:59:13 +0530 [thread overview]
Message-ID: <20260215122913.104064-1-samyak.bambole07@gmail.com> (raw)
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
next reply other threads:[~2026-02-15 12:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-15 12:29 Samyak [this message]
2026-02-16 2:50 ` kernel test robot
2026-02-16 8:14 ` kernel test robot
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=20260215122913.104064-1-samyak.bambole07@gmail.com \
--to=samyak.bambole07@gmail.com \
--cc=ac100@lists.launchpad.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=linux-tegra@vger.kernel.org \
--cc=marvin24@gmx.de \
/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
all inboxes | Powered by JetHome®