[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1176703523.13066.8.camel@wriver-t81fb058.linuxcoe>
Date: Mon, 16 Apr 2007 11:35:23 +0530
From: <vignesh.babu@...ro.com>
To: <mchan@...adcom.com>, <mpl@...adcom.com>
Cc: <netdev@...r.kernel.org>, <kernel-janitors@...ts.osdl.org>
Subject: [KJ][PATCH]sb1250-mac.c-kzalloc
Replacing kmalloc/memset combination with kzalloc.
Signed-off-by: vignesh babu <vignesh.babu@...ro.com>
---
diff --git a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c
index 103c317..af7649f 100644
--- a/drivers/net/sb1250-mac.c
+++ b/drivers/net/sb1250-mac.c
@@ -735,8 +735,8 @@ static void sbdma_initctx(sbmacdma_t *d,
d->sbdma_maxdescr = maxdescr;
- d->sbdma_dscrtable = (sbdmadscr_t *)
- kmalloc((d->sbdma_maxdescr+1)*sizeof(sbdmadscr_t), GFP_KERNEL);
+ d->sbdma_dscrtable =
+ kzalloc((d->sbdma_maxdescr+1)*sizeof(sbdmadscr_t), GFP_KERNEL);
/*
* The descriptor table must be aligned to at least 16 bytes or the
@@ -745,8 +745,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);
@@ -755,10 +753,8 @@ static void sbdma_initctx(sbmacdma_t *d,
* And context table
*/
- 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 *));
+ d->sbdma_ctxtable =
+ kzalloc(d->sbdma_maxdescr*sizeof(struct sk_buff *), GFP_KERNEL);
#ifdef CONFIG_SBMAC_COALESCE
/*
--
Regards,
Vignesh Babu BM
_____________________________________________________________
"Why is it that every time I'm with you, makes me believe in magic?"
Download attachment "smime.p7s" of type "application/x-pkcs7-signature" (3173 bytes)
Powered by blists - more mailing lists