netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 3/5] ATM-nicstar: Improve another size determination in ns_init_card()
Date: Sat, 10 Sep 2016 09:19:33 +0200	[thread overview]
Message-ID: <c8533128-fbcf-f7fe-9354-1949b47cca32@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:30:09 +0200

Replace the specification of a data structure by a reference for a field
in a local variable 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 96062e1..ef977bf 100644
--- a/drivers/atm/nicstar.c
+++ b/drivers/atm/nicstar.c
@@ -611,7 +611,7 @@ static int ns_init_card(int i, struct pci_dev *pcidev)
 	for (j = 0; j < card->rct_size; j++)
 		ns_write_sram(card, j * 4, u32d, 4);
 
-	memset(card->vcmap, 0, NS_MAX_RCTSIZE * sizeof(vc_map));
+	memset(card->vcmap, 0, sizeof(card->vcmap));
 
 	for (j = 0; j < NS_FRSCD_NUM; j++)
 		card->scd2vc[j] = NULL;
-- 
2.10.0

  parent reply	other threads:[~2016-09-10  7:19 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 ` [PATCH 2/5] ATM-nicstar: Improve another size determination " SF Markus Elfring
2016-09-10  7:19 ` SF Markus Elfring [this message]
2016-09-10  7:20 ` [PATCH 4/5] ATM-nicstar: Refactor a kmalloc() call in ns_init_card() 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=c8533128-fbcf-f7fe-9354-1949b47cca32@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).