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/4] ATM-ZeitNet: Improve a size determination in zatm_open()
Date: Sat, 10 Sep 2016 11:01:25 +0200 [thread overview]
Message-ID: <31713ca7-078f-92fe-0595-60c6904004c5@users.sourceforge.net> (raw)
In-Reply-To: <0b5381e1-d725-0706-1cc0-188df6c201f2@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 10 Sep 2016 10:07:38 +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/zatm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c
index d378ff2..218c6af 100644
--- a/drivers/atm/zatm.c
+++ b/drivers/atm/zatm.c
@@ -1399,7 +1399,7 @@ static int zatm_open(struct atm_vcc *vcc)
DPRINTK(DEV_LABEL "(itf %d): open %d.%d\n",vcc->dev->number,vcc->vpi,
vcc->vci);
if (!test_bit(ATM_VF_PARTIAL,&vcc->flags)) {
- zatm_vcc = kmalloc(sizeof(struct zatm_vcc),GFP_KERNEL);
+ zatm_vcc = kmalloc(sizeof(*zatm_vcc), GFP_KERNEL);
if (!zatm_vcc) {
clear_bit(ATM_VF_ADDR,&vcc->flags);
return -ENOMEM;
--
2.10.0
next prev parent reply other threads:[~2016-09-10 9:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-10 8:57 [PATCH 0/4] ATM-ZeitNet: Fine-tuning for three function implementations SF Markus Elfring
2016-09-10 9:00 ` [PATCH 1/4] ATM-ZeitNet: Use kmalloc_array() in start_tx() SF Markus Elfring
2016-09-10 9:01 ` SF Markus Elfring [this message]
2016-09-10 9:02 ` [PATCH 3/4] ATM-ZeitNet: Replace one kzalloc() call by kcalloc() SF Markus Elfring
2016-09-10 9:03 ` [PATCH 4/4] ATM-ZeitNet: Fix indentation for one DPRINTK() call in start_rx() SF Markus Elfring
2016-09-11 4:46 ` [PATCH 0/4] ATM-ZeitNet: 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=31713ca7-078f-92fe-0595-60c6904004c5@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).