All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, Jeff Garzik <jeff@garzik.org>
Subject: [SLHC 2/4] Convert to kzalloc
Date: Thu, 13 Jul 2006 12:10:48 +0100	[thread overview]
Message-ID: <20060713111048.GA19938@linux-mips.org> (raw)

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

---
 drivers/net/slhc.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Index: linux-net/drivers/net/slhc.c
===================================================================
--- linux-net.orig/drivers/net/slhc.c	2006-07-09 02:47:58.000000000 +0100
+++ linux-net/drivers/net/slhc.c	2006-07-10 01:35:51.000000000 +0100
@@ -94,27 +94,24 @@ slhc_init(int rslots, int tslots)
 	register struct cstate *ts;
 	struct slcompress *comp;
 
-	comp = (struct slcompress *)kmalloc(sizeof(struct slcompress),
+	comp = (struct slcompress *)kzalloc(sizeof(struct slcompress),
 					    GFP_KERNEL);
 	if (! comp)
 		goto out_fail;
-	memset(comp, 0, sizeof(struct slcompress));
 
 	if ( rslots > 0  &&  rslots < 256 ) {
 		size_t rsize = rslots * sizeof(struct cstate);
-		comp->rstate = (struct cstate *) kmalloc(rsize, GFP_KERNEL);
+		comp->rstate = (struct cstate *) kzalloc(rsize, GFP_KERNEL);
 		if (! comp->rstate)
 			goto out_free;
-		memset(comp->rstate, 0, rsize);
 		comp->rslot_limit = rslots - 1;
 	}
 
 	if ( tslots > 0  &&  tslots < 256 ) {
 		size_t tsize = tslots * sizeof(struct cstate);
-		comp->tstate = (struct cstate *) kmalloc(tsize, GFP_KERNEL);
+		comp->tstate = (struct cstate *) kzalloc(tsize, GFP_KERNEL);
 		if (! comp->tstate)
 			goto out_free2;
-		memset(comp->tstate, 0, tsize);
 		comp->tslot_limit = tslots - 1;
 	}
 

             reply	other threads:[~2006-07-13 11:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-13 11:10 Ralf Baechle [this message]
2006-07-13 17:08 ` [SLHC 2/4] Convert to kzalloc Christoph Hellwig

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=20060713111048.GA19938@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=davem@davemloft.net \
    --cc=jeff@garzik.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.