From: Surya Prabhakar N <surya.prabhakar@wipro.com>
To: netdev@vger.kernel.org
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [KJ] replacing kmalloc with kzalloc in drivers/net/sb1250-mac.c
Date: Mon, 13 Aug 2007 15:28:43 +0530 [thread overview]
Message-ID: <1186999123.29518.18.camel@bluegenie> (raw)
Hi,
Replacing kmalloc with kzalloc and cleaning up memset in
drivers/net/sb1250-mac.c
Signed-off-by: Surya Prabhakar <surya.prabhakar@wipro.com>
---
diff --git a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c
index e7fdcf1..2dca5a7 100644
--- a/drivers/net/sb1250-mac.c
+++ b/drivers/net/sb1250-mac.c
@@ -760,7 +760,7 @@ static void sbdma_initctx(sbmacdma_t *d,
d->sbdma_dscrtable_unaligned =
d->sbdma_dscrtable = (sbdmadscr_t *)
- kmalloc((d->sbdma_maxdescr+1)*sizeof(sbdmadscr_t), GFP_KERNEL);
+ kzalloc((d->sbdma_maxdescr+1)*sizeof(sbdmadscr_t), GFP_KERNEL);
/*
* The descriptor table must be aligned to at least 16 bytes or the
@@ -769,8 +769,6 @@ static void sbdma_initctx(sbmacdma_t *d,
d->sbdma_dscrtable = (sbdmadscr_t *)
ALIGN((unsigned long)d->sbdma_dscrtable, sizeof(sbdmadscr_t));
- memset(d->sbdma_dscrtable,0,d->sbdma_maxdescr*sizeof(sbdmadscr_t));
-
d->sbdma_dscrtable_end = d->sbdma_dscrtable + d->sbdma_maxdescr;
d->sbdma_dscrtable_phys = virt_to_phys(d->sbdma_dscrtable);
@@ -780,9 +778,7 @@ static void sbdma_initctx(sbmacdma_t *d,
*/
d->sbdma_ctxtable = (struct sk_buff **)
- kmalloc(d->sbdma_maxdescr*sizeof(struct sk_buff *), GFP_KERNEL);
-
- memset(d->sbdma_ctxtable,0,d->sbdma_maxdescr*sizeof(struct sk_buff *));
+ kzalloc(d->sbdma_maxdescr*sizeof(struct sk_buff *), GFP_KERNEL);
#ifdef CONFIG_SBMAC_COALESCE
/*
--
thanks
surya.
next reply other threads:[~2007-08-13 9:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-13 9:58 Surya Prabhakar N [this message]
2007-08-13 15:24 ` [KJ] replacing kmalloc with kzalloc in drivers/net/sb1250-mac.c Robert P. J. Day
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=1186999123.29518.18.camel@bluegenie \
--to=surya.prabhakar@wipro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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