aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block/dasd.c
diff options
context:
space:
mode:
authorEric Sesterhenn <snakebyte@gmx.de>2006-03-24 06:15:31 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-24 10:33:18 -0500
commit88abaab4f9b08381e30e737980a1c49d6b524dfc (patch)
treed33aa82674c00c37cd293c9e888cff785880ce5a /drivers/s390/block/dasd.c
parentfb630517f0d0736ea73af07d6b357be9ad67e6f1 (diff)
[PATCH] s390: kzalloc() conversion in drivers/s390
Convert all kmalloc + memset sequences in drivers/s390 to kzalloc usage. Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/s390/block/dasd.c')
-rw-r--r--drivers/s390/block/dasd.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index f32f7447588b..dfe542b206cc 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -71,10 +71,9 @@ dasd_alloc_device(void)
71{ 71{
72 struct dasd_device *device; 72 struct dasd_device *device;
73 73
74 device = kmalloc(sizeof (struct dasd_device), GFP_ATOMIC); 74 device = kzalloc(sizeof (struct dasd_device), GFP_ATOMIC);
75 if (device == NULL) 75 if (device == NULL)
76 return ERR_PTR(-ENOMEM); 76 return ERR_PTR(-ENOMEM);
77 memset(device, 0, sizeof (struct dasd_device));
78 /* open_count = 0 means device online but not in use */ 77 /* open_count = 0 means device online but not in use */
79 atomic_set(&device->open_count, -1); 78 atomic_set(&device->open_count, -1);
80 79
@@ -547,29 +546,26 @@ dasd_kmalloc_request(char *magic, int cplength, int datasize,
547 (cplength*sizeof(struct ccw1)) > PAGE_SIZE) 546 (cplength*sizeof(struct ccw1)) > PAGE_SIZE)
548 BUG(); 547 BUG();
549 548
550 cqr = kmalloc(sizeof(struct dasd_ccw_req), GFP_ATOMIC); 549 cqr = kzalloc(sizeof(struct dasd_ccw_req), GFP_ATOMIC);
551 if (cqr == NULL) 550 if (cqr == NULL)
552 return ERR_PTR(-ENOMEM); 551 return ERR_PTR(-ENOMEM);
553 memset(cqr, 0, sizeof(struct dasd_ccw_req));
554 cqr->cpaddr = NULL; 552 cqr->cpaddr = NULL;
555 if (cplength > 0) { 553 if (cplength > 0) {
556 cqr->cpaddr = kmalloc(cplength*sizeof(struct ccw1), 554 cqr->cpaddr = kcalloc(cplength, sizeof(struct ccw1),
557 GFP_ATOMIC | GFP_DMA); 555 GFP_ATOMIC | GFP_DMA);
558 if (cqr->cpaddr == NULL) { 556 if (cqr->cpaddr == NULL) {
559 kfree(cqr); 557 kfree(cqr);
560 return ERR_PTR(-ENOMEM); 558 return ERR_PTR(-ENOMEM);
561 } 559 }
562 memset(cqr->cpaddr, 0, cplength*sizeof(struct ccw1));
563 } 560 }
564 cqr->data = NULL; 561 cqr->data = NULL;
565 if (datasize > 0) { 562 if (datasize > 0) {
566 cqr->data = kmalloc(datasize, GFP_ATOMIC | GFP_DMA); 563 cqr->data = kzalloc(datasize, GFP_ATOMIC | GFP_DMA);
567 if (cqr->data == NULL) { 564 if (cqr->data == NULL) {
568 kfree(cqr->cpaddr); 565 kfree(cqr->cpaddr);
569 kfree(cqr); 566 kfree(cqr);
570 return ERR_PTR(-ENOMEM); 567 return ERR_PTR(-ENOMEM);
571 } 568 }
572 memset(cqr->data, 0, datasize);
573 } 569 }
574 strncpy((char *) &cqr->magic, magic, 4); 570 strncpy((char *) &cqr->magic, magic, 4);
575 ASCEBC((char *) &cqr->magic, 4); 571 ASCEBC((char *) &cqr->magic, 4);