diff options
author | Burman Yan <yan_952@hotmail.com> | 2006-12-08 05:39:35 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-08 11:29:01 -0500 |
commit | 41f96935b4c41daea2c4dbbf137960375cf764c1 (patch) | |
tree | 9af3af5e41f68baf063b5f929797c837169bb9df /drivers/isdn/capi | |
parent | 0b2dd130a5a8774a30de1f94266f6b9a9892153c (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/capi')
-rw-r--r-- | drivers/isdn/capi/capi.c | 9 | ||||
-rw-r--r-- | drivers/isdn/capi/capidrv.c | 9 |
2 files changed, 6 insertions, 12 deletions
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c index 0475a54df83a..d22c0224fde6 100644 --- a/drivers/isdn/capi/capi.c +++ b/drivers/isdn/capi/capi.c | |||
@@ -215,13 +215,12 @@ static struct capiminor *capiminor_alloc(struct capi20_appl *ap, u32 ncci) | |||
215 | unsigned int minor = 0; | 215 | unsigned int minor = 0; |
216 | unsigned long flags; | 216 | unsigned long flags; |
217 | 217 | ||
218 | mp = kmalloc(sizeof(*mp), GFP_ATOMIC); | 218 | mp = kzalloc(sizeof(*mp), GFP_ATOMIC); |
219 | if (!mp) { | 219 | if (!mp) { |
220 | printk(KERN_ERR "capi: can't alloc capiminor\n"); | 220 | printk(KERN_ERR "capi: can't alloc capiminor\n"); |
221 | return NULL; | 221 | return NULL; |
222 | } | 222 | } |
223 | 223 | ||
224 | memset(mp, 0, sizeof(struct capiminor)); | ||
225 | mp->ap = ap; | 224 | mp->ap = ap; |
226 | mp->ncci = ncci; | 225 | mp->ncci = ncci; |
227 | mp->msgid = 0; | 226 | mp->msgid = 0; |
@@ -304,10 +303,9 @@ static struct capincci *capincci_alloc(struct capidev *cdev, u32 ncci) | |||
304 | struct capiminor *mp = NULL; | 303 | struct capiminor *mp = NULL; |
305 | #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */ | 304 | #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */ |
306 | 305 | ||
307 | np = kmalloc(sizeof(*np), GFP_ATOMIC); | 306 | np = kzalloc(sizeof(*np), GFP_ATOMIC); |
308 | if (!np) | 307 | if (!np) |
309 | return NULL; | 308 | return NULL; |
310 | memset(np, 0, sizeof(struct capincci)); | ||
311 | np->ncci = ncci; | 309 | np->ncci = ncci; |
312 | np->cdev = cdev; | 310 | np->cdev = cdev; |
313 | #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE | 311 | #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE |
@@ -384,10 +382,9 @@ static struct capidev *capidev_alloc(void) | |||
384 | struct capidev *cdev; | 382 | struct capidev *cdev; |
385 | unsigned long flags; | 383 | unsigned long flags; |
386 | 384 | ||
387 | cdev = kmalloc(sizeof(*cdev), GFP_KERNEL); | 385 | cdev = kzalloc(sizeof(*cdev), GFP_KERNEL); |
388 | if (!cdev) | 386 | if (!cdev) |
389 | return NULL; | 387 | return NULL; |
390 | memset(cdev, 0, sizeof(struct capidev)); | ||
391 | 388 | ||
392 | init_MUTEX(&cdev->ncci_list_sem); | 389 | init_MUTEX(&cdev->ncci_list_sem); |
393 | skb_queue_head_init(&cdev->recvqueue); | 390 | skb_queue_head_init(&cdev->recvqueue); |
diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c index b6f9476c0501..097bfa7bc323 100644 --- a/drivers/isdn/capi/capidrv.c +++ b/drivers/isdn/capi/capidrv.c | |||
@@ -334,12 +334,11 @@ static capidrv_plci *new_plci(capidrv_contr * card, int chan) | |||
334 | { | 334 | { |
335 | capidrv_plci *plcip; | 335 | capidrv_plci *plcip; |
336 | 336 | ||
337 | plcip = (capidrv_plci *) kmalloc(sizeof(capidrv_plci), GFP_ATOMIC); | 337 | plcip = kzalloc(sizeof(capidrv_plci), GFP_ATOMIC); |
338 | 338 | ||
339 | if (plcip == 0) | 339 | if (plcip == 0) |
340 | return NULL; | 340 | return NULL; |
341 | 341 | ||
342 | memset(plcip, 0, sizeof(capidrv_plci)); | ||
343 | plcip->state = ST_PLCI_NONE; | 342 | plcip->state = ST_PLCI_NONE; |
344 | plcip->plci = 0; | 343 | plcip->plci = 0; |
345 | plcip->msgid = 0; | 344 | plcip->msgid = 0; |
@@ -404,12 +403,11 @@ static inline capidrv_ncci *new_ncci(capidrv_contr * card, | |||
404 | { | 403 | { |
405 | capidrv_ncci *nccip; | 404 | capidrv_ncci *nccip; |
406 | 405 | ||
407 | nccip = (capidrv_ncci *) kmalloc(sizeof(capidrv_ncci), GFP_ATOMIC); | 406 | nccip = kzalloc(sizeof(capidrv_ncci), GFP_ATOMIC); |
408 | 407 | ||
409 | if (nccip == 0) | 408 | if (nccip == 0) |
410 | return NULL; | 409 | return NULL; |
411 | 410 | ||
412 | memset(nccip, 0, sizeof(capidrv_ncci)); | ||
413 | nccip->ncci = ncci; | 411 | nccip->ncci = ncci; |
414 | nccip->state = ST_NCCI_NONE; | 412 | nccip->state = ST_NCCI_NONE; |
415 | nccip->plcip = plcip; | 413 | nccip->plcip = plcip; |
@@ -2005,12 +2003,11 @@ static int capidrv_addcontr(u16 contr, struct capi_profile *profp) | |||
2005 | printk(KERN_WARNING "capidrv: (%s) Could not reserve module\n", id); | 2003 | printk(KERN_WARNING "capidrv: (%s) Could not reserve module\n", id); |
2006 | return -1; | 2004 | return -1; |
2007 | } | 2005 | } |
2008 | if (!(card = (capidrv_contr *) kmalloc(sizeof(capidrv_contr), GFP_ATOMIC))) { | 2006 | if (!(card = kzalloc(sizeof(capidrv_contr), GFP_ATOMIC))) { |
2009 | printk(KERN_WARNING | 2007 | printk(KERN_WARNING |
2010 | "capidrv: (%s) Could not allocate contr-struct.\n", id); | 2008 | "capidrv: (%s) Could not allocate contr-struct.\n", id); |
2011 | return -1; | 2009 | return -1; |
2012 | } | 2010 | } |
2013 | memset(card, 0, sizeof(capidrv_contr)); | ||
2014 | card->owner = THIS_MODULE; | 2011 | card->owner = THIS_MODULE; |
2015 | init_timer(&card->listentimer); | 2012 | init_timer(&card->listentimer); |
2016 | strcpy(card->name, id); | 2013 | strcpy(card->name, id); |