Replace kmalloc+memset with kzalloc 
Patch 5/17

Signed-off-by: Yan Burman <yan_952@hotmail.com>

diff -rubp linux-2.6.19-rc5_orig/drivers/block/cciss.c linux-2.6.19-rc5_kzalloc/drivers/block/cciss.c
--- linux-2.6.19-rc5_orig/drivers/block/cciss.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/block/cciss.c	2006-11-11 22:44:04.000000000 +0200
@@ -1969,12 +1969,11 @@ cciss_read_capacity(int ctlr, int logvol
 {
 	ReadCapdata_struct *buf;
 	int return_code;
-	buf = kmalloc(sizeof(ReadCapdata_struct), GFP_KERNEL);
+	buf = kzalloc(sizeof(ReadCapdata_struct), GFP_KERNEL);
 	if (buf == NULL) {
 		printk(KERN_WARNING "cciss: out of memory\n");
 		return;
 	}
-	memset(buf, 0, sizeof(ReadCapdata_struct));
 	if (withirq)
 		return_code = sendcmd_withirq(CCISS_READ_CAPACITY,
 				ctlr, buf, sizeof(ReadCapdata_struct),
@@ -2003,12 +2002,11 @@ cciss_read_capacity_16(int ctlr, int log
 {
 	ReadCapdata_struct_16 *buf;
 	int return_code;
-	buf = kmalloc(sizeof(ReadCapdata_struct_16), GFP_KERNEL);
+	buf = kzalloc(sizeof(ReadCapdata_struct_16), GFP_KERNEL);
 	if (buf == NULL) {
 		printk(KERN_WARNING "cciss: out of memory\n");
 		return;
 	}
-	memset(buf, 0, sizeof(ReadCapdata_struct_16));
 	if (withirq) {
 		return_code = sendcmd_withirq(CCISS_READ_CAPACITY_16,
 			ctlr, buf, sizeof(ReadCapdata_struct_16),
diff -rubp linux-2.6.19-rc5_orig/drivers/block/cpqarray.c linux-2.6.19-rc5_kzalloc/drivers/block/cpqarray.c
--- linux-2.6.19-rc5_orig/drivers/block/cpqarray.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/block/cpqarray.c	2006-11-11 22:44:18.000000000 +0200
@@ -423,7 +423,7 @@ static int __init cpqarray_register_ctlr
 	hba[i]->cmd_pool = (cmdlist_t *)pci_alloc_consistent(
 		hba[i]->pci_dev, NR_CMDS * sizeof(cmdlist_t),
 		&(hba[i]->cmd_pool_dhandle));
-	hba[i]->cmd_pool_bits = kmalloc(
+	hba[i]->cmd_pool_bits = kzalloc(
 		((NR_CMDS+BITS_PER_LONG-1)/BITS_PER_LONG)*sizeof(unsigned long),
 		GFP_KERNEL);
 
@@ -431,7 +431,6 @@ static int __init cpqarray_register_ctlr
 			goto Enomem1;
 
 	memset(hba[i]->cmd_pool, 0, NR_CMDS * sizeof(cmdlist_t));
-	memset(hba[i]->cmd_pool_bits, 0, ((NR_CMDS+BITS_PER_LONG-1)/BITS_PER_LONG)*sizeof(unsigned long));
 	printk(KERN_INFO "cpqarray: Finding drives on %s",
 		hba[i]->devname);
 
@@ -1653,14 +1652,14 @@ static void getgeometry(int ctlr)
 
 	info_p->log_drv_map = 0;	
 	
-	id_ldrive = (id_log_drv_t *)kmalloc(sizeof(id_log_drv_t), GFP_KERNEL);
+	id_ldrive = (id_log_drv_t *)kzalloc(sizeof(id_log_drv_t), GFP_KERNEL);
 	if(id_ldrive == NULL)
 	{
 		printk( KERN_ERR "cpqarray:  out of memory.\n");
 		return;
 	}
 
-	id_ctlr_buf = (id_ctlr_t *)kmalloc(sizeof(id_ctlr_t), GFP_KERNEL);
+	id_ctlr_buf = (id_ctlr_t *)kzalloc(sizeof(id_ctlr_t), GFP_KERNEL);
 	if(id_ctlr_buf == NULL)
 	{
 		kfree(id_ldrive);
@@ -1668,7 +1667,7 @@ static void getgeometry(int ctlr)
 		return;
 	}
 
-	id_lstatus_buf = (sense_log_drv_stat_t *)kmalloc(sizeof(sense_log_drv_stat_t), GFP_KERNEL);
+	id_lstatus_buf = (sense_log_drv_stat_t *)kzalloc(sizeof(sense_log_drv_stat_t), GFP_KERNEL);
 	if(id_lstatus_buf == NULL)
 	{
 		kfree(id_ctlr_buf);
@@ -1677,7 +1676,7 @@ static void getgeometry(int ctlr)
 		return;
 	}
 
-	sense_config_buf = (config_t *)kmalloc(sizeof(config_t), GFP_KERNEL);
+	sense_config_buf = (config_t *)kzalloc(sizeof(config_t), GFP_KERNEL);
 	if(sense_config_buf == NULL)
 	{
 		kfree(id_lstatus_buf);
@@ -1687,11 +1686,6 @@ static void getgeometry(int ctlr)
 		return;
 	}
 
-	memset(id_ldrive, 0, sizeof(id_log_drv_t));
-	memset(id_ctlr_buf, 0, sizeof(id_ctlr_t));
-	memset(id_lstatus_buf, 0, sizeof(sense_log_drv_stat_t));
-	memset(sense_config_buf, 0, sizeof(config_t));
-
 	info_p->phys_drives = 0;
 	info_p->log_drv_map = 0;
 	info_p->drv_assign_map = 0;
diff -rubp linux-2.6.19-rc5_orig/drivers/block/loop.c linux-2.6.19-rc5_kzalloc/drivers/block/loop.c
--- linux-2.6.19-rc5_orig/drivers/block/loop.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/block/loop.c	2006-11-11 22:44:04.000000000 +0200
@@ -1411,10 +1411,9 @@ static int __init loop_init(void)
 	if (register_blkdev(LOOP_MAJOR, "loop"))
 		return -EIO;
 
-	loop_dev = kmalloc(max_loop * sizeof(struct loop_device), GFP_KERNEL);
+	loop_dev = kzalloc(max_loop * sizeof(struct loop_device), GFP_KERNEL);
 	if (!loop_dev)
 		goto out_mem1;
-	memset(loop_dev, 0, max_loop * sizeof(struct loop_device));
 
 	disks = kmalloc(max_loop * sizeof(struct gendisk *), GFP_KERNEL);
 	if (!disks)
diff -rubp linux-2.6.19-rc5_orig/drivers/block/sx8.c linux-2.6.19-rc5_kzalloc/drivers/block/sx8.c
--- linux-2.6.19-rc5_orig/drivers/block/sx8.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/block/sx8.c	2006-11-11 22:44:18.000000000 +0200
@@ -1607,7 +1607,7 @@ static int carm_init_one (struct pci_dev
 	}
 #endif
 
-	host = kmalloc(sizeof(*host), GFP_KERNEL);
+	host = kzalloc(sizeof(*host), GFP_KERNEL);
 	if (!host) {
 		printk(KERN_ERR DRV_NAME "(%s): memory alloc failure\n",
 		       pci_name(pdev));
@@ -1615,7 +1615,6 @@ static int carm_init_one (struct pci_dev
 		goto err_out_regions;
 	}
 
-	memset(host, 0, sizeof(*host));
 	host->pdev = pdev;
 	host->flags = pci_dac ? FL_DAC : 0;
 	spin_lock_init(&host->lock);
diff -rubp linux-2.6.19-rc5_orig/drivers/char/amiserial.c linux-2.6.19-rc5_kzalloc/drivers/char/amiserial.c
--- linux-2.6.19-rc5_orig/drivers/char/amiserial.c	2006-11-09 12:16:20.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/char/amiserial.c	2006-11-11 22:44:04.000000000 +0200
@@ -1730,12 +1730,11 @@ static int get_async_struct(int line, st
 		*ret_info = sstate->info;
 		return 0;
 	}
-	info = kmalloc(sizeof(struct async_struct), GFP_KERNEL);
+	info = kzalloc(sizeof(struct async_struct), GFP_KERNEL);
 	if (!info) {
 		sstate->count--;
 		return -ENOMEM;
 	}
-	memset(info, 0, sizeof(struct async_struct));
 #ifdef DECLARE_WAITQUEUE
 	init_waitqueue_head(&info->open_wait);
 	init_waitqueue_head(&info->close_wait);
diff -rubp linux-2.6.19-rc5_orig/drivers/char/consolemap.c linux-2.6.19-rc5_kzalloc/drivers/char/consolemap.c
--- linux-2.6.19-rc5_orig/drivers/char/consolemap.c	2006-11-09 12:16:20.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/char/consolemap.c	2006-11-11 22:44:04.000000000 +0200
@@ -443,12 +443,11 @@ int con_clear_unimap(struct vc_data *vc,
 	p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc;
 	if (p && p->readonly) return -EIO;
 	if (!p || --p->refcount) {
-		q = (struct uni_pagedir *)kmalloc(sizeof(*p), GFP_KERNEL);
+		q = (struct uni_pagedir *)kzalloc(sizeof(*q), GFP_KERNEL);
 		if (!q) {
 			if (p) p->refcount++;
 			return -ENOMEM;
 		}
-		memset(q, 0, sizeof(*q));
 		q->refcount=1;
 		*vc->vc_uni_pagedir_loc = (unsigned long)q;
 	} else {
diff -rubp linux-2.6.19-rc5_orig/drivers/char/drm/ffb_drv.c linux-2.6.19-rc5_kzalloc/drivers/char/drm/ffb_drv.c
--- linux-2.6.19-rc5_orig/drivers/char/drm/ffb_drv.c	2006-11-09 12:16:20.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/char/drm/ffb_drv.c	2006-11-11 22:44:04.000000000 +0200
@@ -218,10 +218,9 @@ static int ffb_presetup(drm_device_t * d
 		return -ENODEV;
 
 	/* code used to use numdevs no numdevs anymore */
-	ffb_priv = kmalloc(sizeof(ffb_dev_priv_t), GFP_KERNEL);
+	ffb_priv = kzalloc(sizeof(ffb_dev_priv_t), GFP_KERNEL);
 	if (!ffb_priv)
 		return -ENOMEM;
-	memset(ffb_priv, 0, sizeof(*ffb_priv));
 	dev->dev_private = ffb_priv;
 
 	ret = ffb_init_one(dev, ffb_position[i].node, ffb_position[i].root, i);
diff -rubp linux-2.6.19-rc5_orig/drivers/char/drm/via_dmablit.c linux-2.6.19-rc5_kzalloc/drivers/char/drm/via_dmablit.c
--- linux-2.6.19-rc5_orig/drivers/char/drm/via_dmablit.c	2006-11-09 12:16:20.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/char/drm/via_dmablit.c	2006-11-11 22:44:04.000000000 +0200
@@ -271,10 +271,9 @@ via_alloc_desc_pages(drm_via_sg_info_t *
 	vsg->num_desc_pages = (vsg->num_desc + vsg->descriptors_per_page - 1) / 
 		vsg->descriptors_per_page;
 
-	if (NULL ==  (vsg->desc_pages = kmalloc(sizeof(void *) * vsg->num_desc_pages, GFP_KERNEL))) 
+	if (NULL == (vsg->desc_pages = kzalloc(sizeof(void *) * vsg->num_desc_pages, GFP_KERNEL))) 
 		return DRM_ERR(ENOMEM);
 	
-	memset(vsg->desc_pages, 0, sizeof(void *) * vsg->num_desc_pages);
 	vsg->state = dr_via_desc_pages_alloc;
 	for (i=0; i<vsg->num_desc_pages; ++i) {
 		if (NULL == (vsg->desc_pages[i] = 
diff -rubp linux-2.6.19-rc5_orig/drivers/char/esp.c linux-2.6.19-rc5_kzalloc/drivers/char/esp.c
--- linux-2.6.19-rc5_orig/drivers/char/esp.c	2006-11-09 12:16:20.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/char/esp.c	2006-11-11 22:44:04.000000000 +0200
@@ -2464,7 +2464,7 @@ static int __init espserial_init(void)
 		return 1;
 	}
 
-	info = kmalloc(sizeof(struct esp_struct), GFP_KERNEL);
+	info = kzalloc(sizeof(struct esp_struct), GFP_KERNEL);
 
 	if (!info)
 	{
@@ -2474,7 +2474,6 @@ static int __init espserial_init(void)
 		return 1;
 	}
 
-	memset((void *)info, 0, sizeof(struct esp_struct));
 	spin_lock_init(&info->lock);
 	/* rx_trigger, tx_trigger are needed by autoconfig */
 	info->config.rx_trigger = rx_trigger;
@@ -2532,7 +2531,7 @@ static int __init espserial_init(void)
 		if (!dma)
 			info->stat_flags |= ESP_STAT_NEVER_DMA;
 
-		info = kmalloc(sizeof(struct esp_struct), GFP_KERNEL);
+		info = kzalloc(sizeof(struct esp_struct), GFP_KERNEL);
 		if (!info)
 		{
 			printk(KERN_ERR "Couldn't allocate memory for esp serial device information\n"); 
@@ -2541,7 +2540,6 @@ static int __init espserial_init(void)
 			return 0;
 		}
 
-		memset((void *)info, 0, sizeof(struct esp_struct));
 		/* rx_trigger, tx_trigger are needed by autoconfig */
 		info->config.rx_trigger = rx_trigger;
 		info->config.tx_trigger = tx_trigger;
diff -rubp linux-2.6.19-rc5_orig/drivers/char/ftape/lowlevel/ftape-buffer.c linux-2.6.19-rc5_kzalloc/drivers/char/ftape/lowlevel/ftape-buffer.c
--- linux-2.6.19-rc5_orig/drivers/char/ftape/lowlevel/ftape-buffer.c	2006-11-09 12:16:20.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/char/ftape/lowlevel/ftape-buffer.c	2006-11-11 22:44:04.000000000 +0200
@@ -74,11 +74,10 @@ static int add_one_buffer(void)
 	if (ft_nr_buffers >= FT_MAX_NR_BUFFERS) {
 		TRACE_EXIT -ENOMEM;
 	}
-	ft_buffer[ft_nr_buffers] = kmalloc(sizeof(buffer_struct), GFP_KERNEL);
+	ft_buffer[ft_nr_buffers] = kzalloc(sizeof(buffer_struct), GFP_KERNEL);
 	if (ft_buffer[ft_nr_buffers] == NULL) {
 		TRACE_EXIT -ENOMEM;
 	}
-	memset(ft_buffer[ft_nr_buffers], 0, sizeof(buffer_struct));
 	ft_buffer[ft_nr_buffers]->address = dmaalloc(FT_BUFF_SIZE);
 	if (ft_buffer[ft_nr_buffers]->address == NULL) {
 		kfree(ft_buffer[ft_nr_buffers]);
diff -rubp linux-2.6.19-rc5_orig/drivers/char/hvcs.c linux-2.6.19-rc5_kzalloc/drivers/char/hvcs.c
--- linux-2.6.19-rc5_orig/drivers/char/hvcs.c	2006-11-09 12:16:20.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/char/hvcs.c	2006-11-11 22:44:04.000000000 +0200
@@ -620,13 +620,11 @@ static int __devinit hvcs_probe(
 		return -EFAULT;
 	}
 
-	hvcsd = kmalloc(sizeof(*hvcsd), GFP_KERNEL);
+	/* hvcsd->tty is zeroed out with the kzalloc */
+	hvcsd = kzalloc(sizeof(*hvcsd), GFP_KERNEL);
 	if (!hvcsd)
 		return -ENODEV;
 
-	/* hvcsd->tty is zeroed out with the memset */
-	memset(hvcsd, 0x00, sizeof(*hvcsd));
-
 	spin_lock_init(&hvcsd->lock);
 	/* Automatically incs the refcount the first time */
 	kobject_init(&hvcsd->kobj);
diff -rubp linux-2.6.19-rc5_orig/drivers/char/ip2/ip2main.c linux-2.6.19-rc5_kzalloc/drivers/char/ip2/ip2main.c
--- linux-2.6.19-rc5_orig/drivers/char/ip2/ip2main.c	2006-11-09 12:16:20.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/char/ip2/ip2main.c	2006-11-11 22:44:04.000000000 +0200
@@ -647,10 +647,9 @@ ip2_loadmain(int *iop, int *irqp, unsign
 
 	for ( i = 0; i < IP2_MAX_BOARDS; ++i ) {
 		if ( ip2config.addr[i] ) {
-			pB = kmalloc( sizeof(i2eBordStr), GFP_KERNEL);
+			pB = kzalloc( sizeof(i2eBordStr), GFP_KERNEL);
 			if ( pB != NULL ) {
 				i2BoardPtrTable[i] = pB;
-				memset( pB, 0, sizeof(i2eBordStr) );
 				iiSetAddress( pB, ip2config.addr[i], ii2DelayTimer );
 				iiReset( pB );
 			} else {
diff -rubp linux-2.6.19-rc5_orig/drivers/char/ipmi/ipmi_msghandler.c linux-2.6.19-rc5_kzalloc/drivers/char/ipmi/ipmi_msghandler.c
--- linux-2.6.19-rc5_orig/drivers/char/ipmi/ipmi_msghandler.c	2006-11-09 12:16:20.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/char/ipmi/ipmi_msghandler.c	2006-11-11 22:44:04.000000000 +0200
@@ -2423,10 +2423,9 @@ int ipmi_register_smi(struct ipmi_smi_ha
 			return -ENODEV;
 	}
 
-	intf = kmalloc(sizeof(*intf), GFP_KERNEL);
+	intf = kzalloc(sizeof(*intf), GFP_KERNEL);
 	if (!intf)
 		return -ENOMEM;
-	memset(intf, 0, sizeof(*intf));
 	intf->bmc = kzalloc(sizeof(*intf->bmc), GFP_KERNEL);
 	if (!intf->bmc) {
 		kfree(intf);
diff -rubp linux-2.6.19-rc5_orig/drivers/char/pcmcia/synclink_cs.c linux-2.6.19-rc5_kzalloc/drivers/char/pcmcia/synclink_cs.c
--- linux-2.6.19-rc5_orig/drivers/char/pcmcia/synclink_cs.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/char/pcmcia/synclink_cs.c	2006-11-11 22:44:04.000000000 +0200
@@ -539,13 +539,12 @@ static int mgslpc_probe(struct pcmcia_de
     if (debug_level >= DEBUG_LEVEL_INFO)
 	    printk("mgslpc_attach\n");
 
-    info = (MGSLPC_INFO *)kmalloc(sizeof(MGSLPC_INFO), GFP_KERNEL);
+    info = (MGSLPC_INFO *)kzalloc(sizeof(MGSLPC_INFO), GFP_KERNEL);
     if (!info) {
 	    printk("Error can't allocate device instance data\n");
 	    return -ENOMEM;
     }
 
-    memset(info, 0, sizeof(MGSLPC_INFO));
     info->magic = MGSLPC_MAGIC;
     INIT_WORK(&info->task, bh_handler, info);
     info->max_frame_size = 4096;
diff -rubp linux-2.6.19-rc5_orig/drivers/char/random.c linux-2.6.19-rc5_kzalloc/drivers/char/random.c
--- linux-2.6.19-rc5_orig/drivers/char/random.c	2006-11-09 12:16:20.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/char/random.c	2006-11-11 22:44:04.000000000 +0200
@@ -914,11 +914,9 @@ void rand_initialize_irq(int irq)
 	 * If kmalloc returns null, we just won't use that entropy
 	 * source.
 	 */
-	state = kmalloc(sizeof(struct timer_rand_state), GFP_KERNEL);
-	if (state) {
-		memset(state, 0, sizeof(struct timer_rand_state));
+	state = kzalloc(sizeof(struct timer_rand_state), GFP_KERNEL);
+	if (state)
 		irq_timer_state[irq] = state;
-	}
 }
 
 #ifdef CONFIG_BLOCK
@@ -930,11 +928,9 @@ void rand_initialize_disk(struct gendisk
 	 * If kmalloc returns null, we just won't use that entropy
 	 * source.
 	 */
-	state = kmalloc(sizeof(struct timer_rand_state), GFP_KERNEL);
-	if (state) {
-		memset(state, 0, sizeof(struct timer_rand_state));
+	state = kzalloc(sizeof(struct timer_rand_state), GFP_KERNEL);
+	if (state)
 		disk->random = state;
-	}
 }
 #endif
 
diff -rubp linux-2.6.19-rc5_orig/drivers/char/rocket.c linux-2.6.19-rc5_kzalloc/drivers/char/rocket.c
--- linux-2.6.19-rc5_orig/drivers/char/rocket.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/char/rocket.c	2006-11-11 22:44:04.000000000 +0200
@@ -638,12 +638,11 @@ static void init_r_port(int board, int a
 	ctlp = sCtlNumToCtlPtr(board);
 
 	/*  Get a r_port struct for the port, fill it in and save it globally, indexed by line number */
-	info = kmalloc(sizeof (struct r_port), GFP_KERNEL);
+	info = kzalloc(sizeof (struct r_port), GFP_KERNEL);
 	if (!info) {
 		printk(KERN_INFO "Couldn't allocate info struct for line #%d\n", line);
 		return;
 	}
-	memset(info, 0, sizeof (struct r_port));
 
 	info->magic = RPORT_MAGIC;
 	info->line = line;
diff -rubp linux-2.6.19-rc5_orig/drivers/char/synclink.c linux-2.6.19-rc5_kzalloc/drivers/char/synclink.c
--- linux-2.6.19-rc5_orig/drivers/char/synclink.c	2006-11-09 12:16:20.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/char/synclink.c	2006-11-11 22:44:04.000000000 +0200
@@ -4329,13 +4329,12 @@ static struct mgsl_struct* mgsl_allocate
 {
 	struct mgsl_struct *info;
 	
-	info = (struct mgsl_struct *)kmalloc(sizeof(struct mgsl_struct),
+	info = (struct mgsl_struct *)kzalloc(sizeof(struct mgsl_struct),
 		 GFP_KERNEL);
 		 
 	if (!info) {
 		printk("Error can't allocate device instance data\n");
 	} else {
-		memset(info, 0, sizeof(struct mgsl_struct));
 		info->magic = MGSL_MAGIC;
 		INIT_WORK(&info->task, mgsl_bh_handler, info);
 		info->max_frame_size = 4096;
diff -rubp linux-2.6.19-rc5_orig/drivers/char/synclink_gt.c linux-2.6.19-rc5_kzalloc/drivers/char/synclink_gt.c
--- linux-2.6.19-rc5_orig/drivers/char/synclink_gt.c	2006-11-09 12:16:20.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/char/synclink_gt.c	2006-11-11 22:44:04.000000000 +0200
@@ -3318,13 +3318,12 @@ static struct slgt_info *alloc_dev(int a
 {
 	struct slgt_info *info;
 
-	info = kmalloc(sizeof(struct slgt_info), GFP_KERNEL);
+	info = kzalloc(sizeof(struct slgt_info), GFP_KERNEL);
 
 	if (!info) {
 		DBGERR(("%s device alloc failed adapter=%d port=%d\n",
 			driver_name, adapter_num, port_num));
 	} else {
-		memset(info, 0, sizeof(struct slgt_info));
 		info->magic = MGSL_MAGIC;
 		INIT_WORK(&info->task, bh_handler, info);
 		info->max_frame_size = 4096;
diff -rubp linux-2.6.19-rc5_orig/drivers/char/synclinkmp.c linux-2.6.19-rc5_kzalloc/drivers/char/synclinkmp.c
--- linux-2.6.19-rc5_orig/drivers/char/synclinkmp.c	2006-11-09 12:16:20.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/char/synclinkmp.c	2006-11-11 22:44:04.000000000 +0200
@@ -3796,14 +3796,13 @@ static SLMP_INFO *alloc_dev(int adapter_
 {
 	SLMP_INFO *info;
 
-	info = (SLMP_INFO *)kmalloc(sizeof(SLMP_INFO),
+	info = (SLMP_INFO *)kzalloc(sizeof(SLMP_INFO),
 		 GFP_KERNEL);
 
 	if (!info) {
 		printk("%s(%d) Error can't allocate device instance data for adapter %d, port %d\n",
 			__FILE__,__LINE__, adapter_num, port_num);
 	} else {
-		memset(info, 0, sizeof(SLMP_INFO));
 		info->magic = MGSL_MAGIC;
 		INIT_WORK(&info->task, bh_handler, info);
 		info->max_frame_size = 4096;
diff -rubp linux-2.6.19-rc5_orig/drivers/char/tty_io.c linux-2.6.19-rc5_kzalloc/drivers/char/tty_io.c
--- linux-2.6.19-rc5_orig/drivers/char/tty_io.c	2006-11-09 12:16:20.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/char/tty_io.c	2006-11-11 22:44:04.000000000 +0200
@@ -1911,11 +1911,10 @@ static int init_dev(struct tty_driver *d
 	}
 
 	if (!*ltp_loc) {
-		ltp = (struct termios *) kmalloc(sizeof(struct termios),
+		ltp = (struct termios *) kzalloc(sizeof(struct termios),
 						 GFP_KERNEL);
 		if (!ltp)
 			goto free_mem_out;
-		memset(ltp, 0, sizeof(struct termios));
 	}
 
 	if (driver->type == TTY_DRIVER_TYPE_PTY) {
@@ -1945,10 +1944,9 @@ static int init_dev(struct tty_driver *d
 
 		if (!*o_ltp_loc) {
 			o_ltp = (struct termios *)
-				kmalloc(sizeof(struct termios), GFP_KERNEL);
+				kzalloc(sizeof(struct termios), GFP_KERNEL);
 			if (!o_ltp)
 				goto free_mem_out;
-			memset(o_ltp, 0, sizeof(struct termios));
 		}
 
 		/*
@@ -3665,9 +3663,8 @@ struct tty_driver *alloc_tty_driver(int 
 {
 	struct tty_driver *driver;
 
-	driver = kmalloc(sizeof(struct tty_driver), GFP_KERNEL);
+	driver = kzalloc(sizeof(struct tty_driver), GFP_KERNEL);
 	if (driver) {
-		memset(driver, 0, sizeof(struct tty_driver));
 		driver->magic = TTY_DRIVER_MAGIC;
 		driver->num = lines;
 		/* later we'll move allocation of tables here */
@@ -3727,10 +3724,9 @@ int tty_register_driver(struct tty_drive
 		return 0;
 
 	if (!(driver->flags & TTY_DRIVER_DEVPTS_MEM)) {
-		p = kmalloc(driver->num * 3 * sizeof(void *), GFP_KERNEL);
+		p = kzalloc(driver->num * 3 * sizeof(void *), GFP_KERNEL);
 		if (!p)
 			return -ENOMEM;
-		memset(p, 0, driver->num * 3 * sizeof(void *));
 	}
 
 	if (!driver->major) {
diff -rubp linux-2.6.19-rc5_orig/drivers/char/vt.c linux-2.6.19-rc5_kzalloc/drivers/char/vt.c
--- linux-2.6.19-rc5_orig/drivers/char/vt.c	2006-11-09 12:16:20.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/char/vt.c	2006-11-11 22:44:04.000000000 +0200
@@ -722,10 +722,9 @@ int vc_allocate(unsigned int currcons)	/
 	    /* although the numbers above are not valid since long ago, the
 	       point is still up-to-date and the comment still has its value
 	       even if only as a historical artifact.  --mj, July 1998 */
-	    vc = kmalloc(sizeof(struct vc_data), GFP_KERNEL);
+	    vc = kzalloc(sizeof(struct vc_data), GFP_KERNEL);
 	    if (!vc)
 		return -ENOMEM;
-	    memset(vc, 0, sizeof(*vc));
 	    vc_cons[currcons].d = vc;
 	    visual_init(vc, currcons, 1);
 	    if (!*vc->vc_uni_pagedir_loc)
diff -rubp linux-2.6.19-rc5_orig/drivers/char/watchdog/mpcore_wdt.c linux-2.6.19-rc5_kzalloc/drivers/char/watchdog/mpcore_wdt.c
--- linux-2.6.19-rc5_orig/drivers/char/watchdog/mpcore_wdt.c	2006-11-09 12:16:20.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/char/watchdog/mpcore_wdt.c	2006-11-11 22:44:04.000000000 +0200
@@ -328,12 +328,11 @@ static int __devinit mpcore_wdt_probe(st
 		goto err_out;
 	}
 
-	wdt = kmalloc(sizeof(struct mpcore_wdt), GFP_KERNEL);
+	wdt = kzalloc(sizeof(struct mpcore_wdt), GFP_KERNEL);
 	if (!wdt) {
 		ret = -ENOMEM;
 		goto err_out;
 	}
-	memset(wdt, 0, sizeof(struct mpcore_wdt));
 
 	wdt->dev = &dev->dev;
 	wdt->irq = platform_get_irq(dev, 0);
diff -rubp linux-2.6.19-rc5_orig/drivers/edac/edac_mc.c linux-2.6.19-rc5_kzalloc/drivers/edac/edac_mc.c
--- linux-2.6.19-rc5_orig/drivers/edac/edac_mc.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/edac/edac_mc.c	2006-11-11 22:44:18.000000000 +0200
@@ -1280,7 +1280,8 @@ struct mem_ctl_info *edac_mc_alloc(unsig
 	pvt = align_ptr(&chi[nr_chans * nr_csrows], sz_pvt);
 	size = ((unsigned long) pvt) + sz_pvt;
 
-	if ((mci = kmalloc(size, GFP_KERNEL)) == NULL)
+	/* clear all the fields */
+	if ((mci = kzalloc(size, GFP_KERNEL)) == NULL)
 		return NULL;
 
 	/* Adjust pointers so they point within the memory we just allocated
@@ -1290,7 +1291,6 @@ struct mem_ctl_info *edac_mc_alloc(unsig
 	chi = (struct channel_info *) (((char *) mci) + ((unsigned long) chi));
 	pvt = sz_pvt ? (((char *) mci) + ((unsigned long) pvt)) : NULL;
 
-	memset(mci, 0, size);  /* clear all fields */
 	mci->csrows = csi;
 	mci->pvt_info = pvt;
 	mci->nr_csrows = nr_csrows;
diff -rubp linux-2.6.19-rc5_orig/drivers/infiniband/core/addr.c linux-2.6.19-rc5_kzalloc/drivers/infiniband/core/addr.c
--- linux-2.6.19-rc5_orig/drivers/infiniband/core/addr.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/infiniband/core/addr.c	2006-11-11 22:44:04.000000000 +0200
@@ -297,10 +297,9 @@ int rdma_resolve_ip(struct rdma_addr_cli
 	struct addr_req *req;
 	int ret = 0;
 
-	req = kmalloc(sizeof *req, GFP_KERNEL);
+	req = kzalloc(sizeof *req, GFP_KERNEL);
 	if (!req)
 		return -ENOMEM;
-	memset(req, 0, sizeof *req);
 
 	if (src_addr)
 		memcpy(&req->src_addr, src_addr, ip_addr_size(src_addr));
diff -rubp linux-2.6.19-rc5_orig/drivers/input/serio/ambakmi.c linux-2.6.19-rc5_kzalloc/drivers/input/serio/ambakmi.c
--- linux-2.6.19-rc5_orig/drivers/input/serio/ambakmi.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/input/serio/ambakmi.c	2006-11-11 22:44:04.000000000 +0200
@@ -117,16 +117,13 @@ static int amba_kmi_probe(struct amba_de
 	if (ret)
 		return ret;
 
-	kmi = kmalloc(sizeof(struct amba_kmi_port), GFP_KERNEL);
-	io = kmalloc(sizeof(struct serio), GFP_KERNEL);
+	kmi = kzalloc(sizeof(struct amba_kmi_port), GFP_KERNEL);
+	io = kzalloc(sizeof(struct serio), GFP_KERNEL);
 	if (!kmi || !io) {
 		ret = -ENOMEM;
 		goto out;
 	}
 
-	memset(kmi, 0, sizeof(struct amba_kmi_port));
-	memset(io, 0, sizeof(struct serio));
-
 	io->id.type	= SERIO_8042;
 	io->write	= amba_kmi_write;
 	io->open	= amba_kmi_open;
diff -rubp linux-2.6.19-rc5_orig/drivers/input/serio/gscps2.c linux-2.6.19-rc5_kzalloc/drivers/input/serio/gscps2.c
--- linux-2.6.19-rc5_orig/drivers/input/serio/gscps2.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/input/serio/gscps2.c	2006-11-11 22:44:18.000000000 +0200
@@ -340,8 +340,8 @@ static int __init gscps2_probe(struct pa
 	if (dev->id.sversion == 0x96)
 		hpa += GSC_DINO_OFFSET;
 
-	ps2port = kmalloc(sizeof(struct gscps2port), GFP_KERNEL);
-	serio = kmalloc(sizeof(struct serio), GFP_KERNEL);
+	ps2port = kzalloc(sizeof(struct gscps2port), GFP_KERNEL);
+	serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
 	if (!ps2port || !serio) {
 		ret = -ENOMEM;
 		goto fail_nomem;
@@ -349,8 +349,6 @@ static int __init gscps2_probe(struct pa
 
 	dev_set_drvdata(&dev->dev, ps2port);
 
-	memset(ps2port, 0, sizeof(struct gscps2port));
-	memset(serio, 0, sizeof(struct serio));
 	ps2port->port = serio;
 	ps2port->padev = dev;
 	ps2port->addr = ioremap_nocache(hpa, GSC_STATUS + 4);
diff -rubp linux-2.6.19-rc5_orig/drivers/input/serio/pcips2.c linux-2.6.19-rc5_kzalloc/drivers/input/serio/pcips2.c
--- linux-2.6.19-rc5_orig/drivers/input/serio/pcips2.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/input/serio/pcips2.c	2006-11-11 22:44:04.000000000 +0200
@@ -140,16 +140,13 @@ static int __devinit pcips2_probe(struct
 	if (ret)
 		goto disable;
 
-	ps2if = kmalloc(sizeof(struct pcips2_data), GFP_KERNEL);
-	serio = kmalloc(sizeof(struct serio), GFP_KERNEL);
+	ps2if = kzalloc(sizeof(struct pcips2_data), GFP_KERNEL);
+	serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
 	if (!ps2if || !serio) {
 		ret = -ENOMEM;
 		goto release;
 	}
 
-	memset(ps2if, 0, sizeof(struct pcips2_data));
-	memset(serio, 0, sizeof(struct serio));
-
 	serio->id.type		= SERIO_8042;
 	serio->write		= pcips2_write;
 	serio->open		= pcips2_open;
diff -rubp linux-2.6.19-rc5_orig/drivers/input/serio/sa1111ps2.c linux-2.6.19-rc5_kzalloc/drivers/input/serio/sa1111ps2.c
--- linux-2.6.19-rc5_orig/drivers/input/serio/sa1111ps2.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/input/serio/sa1111ps2.c	2006-11-11 22:44:04.000000000 +0200
@@ -234,16 +234,13 @@ static int ps2_probe(struct sa1111_dev *
 	struct serio *serio;
 	int ret;
 
-	ps2if = kmalloc(sizeof(struct ps2if), GFP_KERNEL);
-	serio = kmalloc(sizeof(struct serio), GFP_KERNEL);
+	ps2if = kzalloc(sizeof(struct ps2if), GFP_KERNEL);
+	serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
 	if (!ps2if || !serio) {
 		ret = -ENOMEM;
 		goto free;
 	}
 
-	memset(ps2if, 0, sizeof(struct ps2if));
-	memset(serio, 0, sizeof(struct serio));
-
 	serio->id.type		= SERIO_8042;
 	serio->write		= ps2_write;
 	serio->open		= ps2_open;
