linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [09/22] Cyclades PC300 driver: use kzalloc() so we don't have to memset()
@ 2012-01-30  2:50 Andrea Shepard
  0 siblings, 0 replies; only message in thread
From: Andrea Shepard @ 2012-01-30  2:50 UTC (permalink / raw)
  To: linux-kernel, netdev
  Cc: khc, davem, mmarek, jkosina, joe, justinmattock, gregkh, alan, jdmason

Use kzalloc() and avoid a memset().

Signed-off-by: Andrea Shepard <andrea@persephoneslair.org>

diff --git a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c
index f6da796..a8f3184 100644
--- a/drivers/net/wan/pc300_drv.c
+++ b/drivers/net/wan/pc300_drv.c
@@ -234,6 +234,7 @@ static char rcsid[] =
 #include <linux/etherdevice.h>
 #include <linux/spinlock.h>
 #include <linux/if.h>
+#include <linux/slab.h>
 #include <net/arp.h>
 
 #include <asm/io.h>
@@ -3572,14 +3573,13 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 #endif
 	}
 
-	card = (pc300_t *) kmalloc(sizeof(pc300_t), GFP_KERNEL);
+	card = kzalloc(sizeof(pc300_t), GFP_KERNEL);
 	if (card == NULL) {
 		printk("PC300 found at RAM 0x%08lx, "
 		       "but could not allocate card structure.\n",
 		       pci_resource_start(pdev, 3));
 		return -ENOMEM;
 	}
-	memset(card, 0, sizeof(pc300_t));
 
 	/* read PCI configuration area */
 	device_id = ent->device;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-01-30  2:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-30  2:50 [09/22] Cyclades PC300 driver: use kzalloc() so we don't have to memset() Andrea Shepard

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).