From: Sandhya Bankar <bankarsandhya512@gmail.com>
To: outreachy-kernel@googlegroups.com
Subject: [PATCH] Staging: slicoss: Use sizeof structure *pointer over sizeof structure in kmalloc()/kzalloc().
Date: Mon, 22 Feb 2016 16:06:51 +0530 [thread overview]
Message-ID: <20160222103651.GA5176@sandhya> (raw)
Use sizeof structure *pointer over sizeof structure in kmalloc()/kzalloc().
Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
---
drivers/staging/slicoss/slicoss.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index a91c60a..ea6b7b5 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -880,7 +880,7 @@ static int slic_upr_queue_request(struct adapter *adapter,
struct slic_upr *upr;
struct slic_upr *uprqueue;
- upr = kmalloc(sizeof(struct slic_upr), GFP_ATOMIC);
+ upr = kmalloc(sizeof(*upr), GFP_ATOMIC);
if (!upr)
return -ENOMEM;
@@ -1806,7 +1806,7 @@ static int slic_mcast_add_list(struct adapter *adapter, char *address)
}
/* Doesn't already exist. Allocate a structure to hold it */
- mcaddr = kmalloc(sizeof(struct mcast_address), GFP_ATOMIC);
+ mcaddr = kmalloc(sizeof(*mcaddr), GFP_ATOMIC);
if (mcaddr == NULL)
return 1;
@@ -3049,7 +3049,7 @@ static u32 slic_card_locate(struct adapter *adapter)
}
if (!physcard) {
/* no structure allocated for this physical card yet */
- physcard = kzalloc(sizeof(struct physcard), GFP_ATOMIC);
+ physcard = kzalloc(sizeof(*physcard), GFP_ATOMIC);
if (!physcard) {
if (card_hostid == SLIC_HOSTID_DEFAULT)
kfree(card);
--
1.8.3.4
next reply other threads:[~2016-02-22 18:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-22 10:36 Sandhya Bankar [this message]
2016-02-23 19:39 ` [Outreachy kernel] [PATCH] Staging: slicoss: Use sizeof structure *pointer over sizeof structure in kmalloc()/kzalloc() Julia Lawall
2016-02-23 19:46 ` sandhya bankar
2016-02-23 19:56 ` Julia Lawall
2016-02-23 19:59 ` sandhya bankar
2016-02-23 20:46 ` sandhya bankar
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=20160222103651.GA5176@sandhya \
--to=bankarsandhya512@gmail.com \
--cc=outreachy-kernel@googlegroups.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.