From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org,
Chas Williams <3chas3@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org,
Julia Lawall <julia.lawall@lip6.fr>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: [PATCH 2/5] ATM-nicstar: Improve another size determination in get_scq()
Date: Sat, 10 Sep 2016 09:18:46 +0200 [thread overview]
Message-ID: <0bd4a38e-cd33-ecda-ed3a-73f743ed46e2@users.sourceforge.net> (raw)
In-Reply-To: <fe480e1f-285a-bb98-3550-b4fa354f8174@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 10 Sep 2016 08:18:10 +0200
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/atm/nicstar.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c
index 50dec13..96062e1 100644
--- a/drivers/atm/nicstar.c
+++ b/drivers/atm/nicstar.c
@@ -862,7 +862,7 @@ static scq_info *get_scq(ns_dev *card, int size, u32 scd)
if (size != VBR_SCQSIZE && size != CBR_SCQSIZE)
return NULL;
- scq = kmalloc(sizeof(scq_info), GFP_KERNEL);
+ scq = kmalloc(sizeof(*scq), GFP_KERNEL);
if (!scq)
return NULL;
scq->org = dma_alloc_coherent(&card->pcidev->dev,
--
2.10.0
next prev parent reply other threads:[~2016-09-10 7:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-10 7:15 [PATCH 0/5] ATM-nicstar: Fine-tuning for three function implementations SF Markus Elfring
2016-09-10 7:17 ` [PATCH 1/5] ATM-nicstar: Use kmalloc_array() in get_scq() SF Markus Elfring
2016-09-10 7:18 ` SF Markus Elfring [this message]
2016-09-10 7:19 ` [PATCH 3/5] ATM-nicstar: Improve another size determination in ns_init_card() SF Markus Elfring
2016-09-10 7:20 ` [PATCH 4/5] ATM-nicstar: Refactor a kmalloc() call " SF Markus Elfring
2016-09-10 7:21 ` [PATCH 5/5] ATM-nicstar: Refactor a dev_alloc_skb() call in dequeue_rx() SF Markus Elfring
2016-09-11 4:46 ` [PATCH 0/5] ATM-nicstar: Fine-tuning for three function implementations David Miller
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=0bd4a38e-cd33-ecda-ed3a-73f743ed46e2@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=3chas3@gmail.com \
--cc=julia.lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-atm-general@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pbonzini@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).