aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hysdn
diff options
context:
space:
mode:
authorBurman Yan <yan_952@hotmail.com>2006-12-08 05:39:35 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:29:01 -0500
commit41f96935b4c41daea2c4dbbf137960375cf764c1 (patch)
tree9af3af5e41f68baf063b5f929797c837169bb9df /drivers/isdn/hysdn
parent0b2dd130a5a8774a30de1f94266f6b9a9892153c (diff)
[PATCH] isdn: replace kmalloc+memset with kzalloc
Acked-by: Karsten Keil <kkeil@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/isdn/hysdn')
-rw-r--r--drivers/isdn/hysdn/hycapi.c3
-rw-r--r--drivers/isdn/hysdn/hysdn_boot.c3
-rw-r--r--drivers/isdn/hysdn/hysdn_init.c3
-rw-r--r--drivers/isdn/hysdn/hysdn_net.c3
-rw-r--r--drivers/isdn/hysdn/hysdn_proclog.c3
5 files changed, 5 insertions, 10 deletions
diff --git a/drivers/isdn/hysdn/hycapi.c b/drivers/isdn/hysdn/hycapi.c
index 6bac43cc91bd..b2ae4ec1e49e 100644
--- a/drivers/isdn/hysdn/hycapi.c
+++ b/drivers/isdn/hysdn/hycapi.c
@@ -745,12 +745,11 @@ hycapi_capi_create(hysdn_card *card)
745 return 1; 745 return 1;
746 } 746 }
747 if (!card->hyctrlinfo) { 747 if (!card->hyctrlinfo) {
748 cinfo = (hycapictrl_info *) kmalloc(sizeof(hycapictrl_info), GFP_ATOMIC); 748 cinfo = kzalloc(sizeof(hycapictrl_info), GFP_ATOMIC);
749 if (!cinfo) { 749 if (!cinfo) {
750 printk(KERN_WARNING "HYSDN: no memory for capi-ctrl.\n"); 750 printk(KERN_WARNING "HYSDN: no memory for capi-ctrl.\n");
751 return -ENOMEM; 751 return -ENOMEM;
752 } 752 }
753 memset(cinfo, 0, sizeof(hycapictrl_info));
754 card->hyctrlinfo = cinfo; 753 card->hyctrlinfo = cinfo;
755 cinfo->card = card; 754 cinfo->card = card;
756 spin_lock_init(&cinfo->lock); 755 spin_lock_init(&cinfo->lock);
diff --git a/drivers/isdn/hysdn/hysdn_boot.c b/drivers/isdn/hysdn/hysdn_boot.c
index 6d0eb0f42fca..be787e16bb79 100644
--- a/drivers/isdn/hysdn/hysdn_boot.c
+++ b/drivers/isdn/hysdn/hysdn_boot.c
@@ -278,14 +278,13 @@ pof_write_open(hysdn_card * card, unsigned char **bufp)
278 return (-ERR_ALREADY_BOOT); /* boot already active */ 278 return (-ERR_ALREADY_BOOT); /* boot already active */
279 } 279 }
280 /* error no mem available */ 280 /* error no mem available */
281 if (!(boot = kmalloc(sizeof(struct boot_data), GFP_KERNEL))) { 281 if (!(boot = kzalloc(sizeof(struct boot_data), GFP_KERNEL))) {
282 if (card->debug_flags & LOG_MEM_ERR) 282 if (card->debug_flags & LOG_MEM_ERR)
283 hysdn_addlog(card, "POF open: unable to allocate mem"); 283 hysdn_addlog(card, "POF open: unable to allocate mem");
284 return (-EFAULT); 284 return (-EFAULT);
285 } 285 }
286 card->boot = boot; 286 card->boot = boot;
287 card->state = CARD_STATE_BOOTING; 287 card->state = CARD_STATE_BOOTING;
288 memset(boot, 0, sizeof(struct boot_data));
289 288
290 card->stopcard(card); /* first stop the card */ 289 card->stopcard(card); /* first stop the card */
291 if (card->testram(card)) { 290 if (card->testram(card)) {
diff --git a/drivers/isdn/hysdn/hysdn_init.c b/drivers/isdn/hysdn/hysdn_init.c
index b702ed27252b..9e01748a176e 100644
--- a/drivers/isdn/hysdn/hysdn_init.c
+++ b/drivers/isdn/hysdn/hysdn_init.c
@@ -81,11 +81,10 @@ search_cards(void)
81 if (pci_enable_device(akt_pcidev)) 81 if (pci_enable_device(akt_pcidev))
82 continue; 82 continue;
83 83
84 if (!(card = kmalloc(sizeof(hysdn_card), GFP_KERNEL))) { 84 if (!(card = kzalloc(sizeof(hysdn_card), GFP_KERNEL))) {
85 printk(KERN_ERR "HYSDN: unable to alloc device mem \n"); 85 printk(KERN_ERR "HYSDN: unable to alloc device mem \n");
86 return; 86 return;
87 } 87 }
88 memset(card, 0, sizeof(hysdn_card));
89 card->myid = cardmax; /* set own id */ 88 card->myid = cardmax; /* set own id */
90 card->bus = akt_pcidev->bus->number; 89 card->bus = akt_pcidev->bus->number;
91 card->devfn = akt_pcidev->devfn; /* slot + function */ 90 card->devfn = akt_pcidev->devfn; /* slot + function */
diff --git a/drivers/isdn/hysdn/hysdn_net.c b/drivers/isdn/hysdn/hysdn_net.c
index d205249a1242..557d96c78a62 100644
--- a/drivers/isdn/hysdn/hysdn_net.c
+++ b/drivers/isdn/hysdn/hysdn_net.c
@@ -278,11 +278,10 @@ hysdn_net_create(hysdn_card * card)
278 return (-ENOMEM); 278 return (-ENOMEM);
279 } 279 }
280 hysdn_net_release(card); /* release an existing net device */ 280 hysdn_net_release(card); /* release an existing net device */
281 if ((dev = kmalloc(sizeof(struct net_local), GFP_KERNEL)) == NULL) { 281 if ((dev = kzalloc(sizeof(struct net_local), GFP_KERNEL)) == NULL) {
282 printk(KERN_WARNING "HYSDN: unable to allocate mem\n"); 282 printk(KERN_WARNING "HYSDN: unable to allocate mem\n");
283 return (-ENOMEM); 283 return (-ENOMEM);
284 } 284 }
285 memset(dev, 0, sizeof(struct net_local)); /* clean the structure */
286 285
287 spin_lock_init(&((struct net_local *) dev)->lock); 286 spin_lock_init(&((struct net_local *) dev)->lock);
288 287
diff --git a/drivers/isdn/hysdn/hysdn_proclog.c b/drivers/isdn/hysdn/hysdn_proclog.c
index 4d238eff1773..f241f5e551cb 100644
--- a/drivers/isdn/hysdn/hysdn_proclog.c
+++ b/drivers/isdn/hysdn/hysdn_proclog.c
@@ -405,8 +405,7 @@ hysdn_proclog_init(hysdn_card * card)
405 405
406 /* create a cardlog proc entry */ 406 /* create a cardlog proc entry */
407 407
408 if ((pd = (struct procdata *) kmalloc(sizeof(struct procdata), GFP_KERNEL)) != NULL) { 408 if ((pd = kzalloc(sizeof(struct procdata), GFP_KERNEL)) != NULL) {
409 memset(pd, 0, sizeof(struct procdata));
410 sprintf(pd->log_name, "%s%d", PROC_LOG_BASENAME, card->myid); 409 sprintf(pd->log_name, "%s%d", PROC_LOG_BASENAME, card->myid);
411 if ((pd->log = create_proc_entry(pd->log_name, S_IFREG | S_IRUGO | S_IWUSR, hysdn_proc_entry)) != NULL) { 410 if ((pd->log = create_proc_entry(pd->log_name, S_IFREG | S_IRUGO | S_IWUSR, hysdn_proc_entry)) != NULL) {
412 pd->log->proc_fops = &log_fops; 411 pd->log->proc_fops = &log_fops;