From: Kimberly Brown <kimbrownkd@gmail.com>
To: outreachy-kernel@googlegroups.com
Cc: Rob Springer <rspringer@google.com>,
Todd Poynor <toddpoynor@google.com>,
Ben Chan <benchan@chromium.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [PATCH] staging: gasket: interrupt: use sizeof(*p) for memory allocation
Date: Wed, 24 Oct 2018 00:16:02 -0400 [thread overview]
Message-ID: <20181024041602.GA2385@v> (raw)
Use sizeof(*p) instead of sizeof(struct P) for memory allocation. This
change complies with the Linux kernel coding style. It improves
readability and decreases the opportunity for bugs if the pointer
variable type is changed. Issue found by checkpatch.
Signed-off-by: Kimberly Brown <kimbrownkd@gmail.com>
---
drivers/staging/gasket/gasket_interrupt.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/gasket/gasket_interrupt.c b/drivers/staging/gasket/gasket_interrupt.c
index 49d47afad64f..8353ab50b3ec 100644
--- a/drivers/staging/gasket/gasket_interrupt.c
+++ b/drivers/staging/gasket/gasket_interrupt.c
@@ -322,8 +322,7 @@ int gasket_interrupt_init(struct gasket_dev *gasket_dev)
const struct gasket_driver_desc *driver_desc =
gasket_get_driver_desc(gasket_dev);
- interrupt_data = kzalloc(sizeof(struct gasket_interrupt_data),
- GFP_KERNEL);
+ interrupt_data = kzalloc(sizeof(*interrupt_data), GFP_KERNEL);
if (!interrupt_data)
return -ENOMEM;
gasket_dev->interrupt_data = interrupt_data;
--
2.17.1
next reply other threads:[~2018-10-24 4:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-24 4:16 Kimberly Brown [this message]
2018-10-24 10:52 ` [Outreachy kernel] [PATCH] staging: gasket: interrupt: use sizeof(*p) for memory allocation Sasha Levin
2018-10-26 0:04 ` [PATCH v2] staging: gasket: " Kimberly Brown
2018-10-28 19:32 ` Todd Poynor
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=20181024041602.GA2385@v \
--to=kimbrownkd@gmail.com \
--cc=benchan@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=outreachy-kernel@googlegroups.com \
--cc=rspringer@google.com \
--cc=toddpoynor@google.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.