diff options
author | Eric Sesterhenn <snakebyte@gmx.de> | 2006-03-24 06:15:31 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-24 10:33:18 -0500 |
commit | 88abaab4f9b08381e30e737980a1c49d6b524dfc (patch) | |
tree | d33aa82674c00c37cd293c9e888cff785880ce5a /drivers/s390/cio/qdio.c | |
parent | fb630517f0d0736ea73af07d6b357be9ad67e6f1 (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/cio/qdio.c')
-rw-r--r-- | drivers/s390/cio/qdio.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c index 9ed37dc9a1b0..814f9258ce00 100644 --- a/drivers/s390/cio/qdio.c +++ b/drivers/s390/cio/qdio.c | |||
@@ -1686,16 +1686,14 @@ qdio_alloc_qs(struct qdio_irq *irq_ptr, | |||
1686 | int result=-ENOMEM; | 1686 | int result=-ENOMEM; |
1687 | 1687 | ||
1688 | for (i=0;i<no_input_qs;i++) { | 1688 | for (i=0;i<no_input_qs;i++) { |
1689 | q=kmalloc(sizeof(struct qdio_q),GFP_KERNEL); | 1689 | q = kzalloc(sizeof(struct qdio_q), GFP_KERNEL); |
1690 | 1690 | ||
1691 | if (!q) { | 1691 | if (!q) { |
1692 | QDIO_PRINT_ERR("kmalloc of q failed!\n"); | 1692 | QDIO_PRINT_ERR("kmalloc of q failed!\n"); |
1693 | goto out; | 1693 | goto out; |
1694 | } | 1694 | } |
1695 | 1695 | ||
1696 | memset(q,0,sizeof(struct qdio_q)); | 1696 | q->slib = kmalloc(PAGE_SIZE, GFP_KERNEL); |
1697 | |||
1698 | q->slib=kmalloc(PAGE_SIZE,GFP_KERNEL); | ||
1699 | if (!q->slib) { | 1697 | if (!q->slib) { |
1700 | QDIO_PRINT_ERR("kmalloc of slib failed!\n"); | 1698 | QDIO_PRINT_ERR("kmalloc of slib failed!\n"); |
1701 | goto out; | 1699 | goto out; |
@@ -1705,14 +1703,12 @@ qdio_alloc_qs(struct qdio_irq *irq_ptr, | |||
1705 | } | 1703 | } |
1706 | 1704 | ||
1707 | for (i=0;i<no_output_qs;i++) { | 1705 | for (i=0;i<no_output_qs;i++) { |
1708 | q=kmalloc(sizeof(struct qdio_q),GFP_KERNEL); | 1706 | q = kzalloc(sizeof(struct qdio_q), GFP_KERNEL); |
1709 | 1707 | ||
1710 | if (!q) { | 1708 | if (!q) { |
1711 | goto out; | 1709 | goto out; |
1712 | } | 1710 | } |
1713 | 1711 | ||
1714 | memset(q,0,sizeof(struct qdio_q)); | ||
1715 | |||
1716 | q->slib=kmalloc(PAGE_SIZE,GFP_KERNEL); | 1712 | q->slib=kmalloc(PAGE_SIZE,GFP_KERNEL); |
1717 | if (!q->slib) { | 1713 | if (!q->slib) { |
1718 | QDIO_PRINT_ERR("kmalloc of slib failed!\n"); | 1714 | QDIO_PRINT_ERR("kmalloc of slib failed!\n"); |
@@ -2984,7 +2980,7 @@ qdio_allocate(struct qdio_initialize *init_data) | |||
2984 | qdio_allocate_do_dbf(init_data); | 2980 | qdio_allocate_do_dbf(init_data); |
2985 | 2981 | ||
2986 | /* create irq */ | 2982 | /* create irq */ |
2987 | irq_ptr=kmalloc(sizeof(struct qdio_irq), GFP_KERNEL | GFP_DMA); | 2983 | irq_ptr = kzalloc(sizeof(struct qdio_irq), GFP_KERNEL | GFP_DMA); |
2988 | 2984 | ||
2989 | QDIO_DBF_TEXT0(0,setup,"irq_ptr:"); | 2985 | QDIO_DBF_TEXT0(0,setup,"irq_ptr:"); |
2990 | QDIO_DBF_HEX0(0,setup,&irq_ptr,sizeof(void*)); | 2986 | QDIO_DBF_HEX0(0,setup,&irq_ptr,sizeof(void*)); |
@@ -2994,8 +2990,6 @@ qdio_allocate(struct qdio_initialize *init_data) | |||
2994 | return -ENOMEM; | 2990 | return -ENOMEM; |
2995 | } | 2991 | } |
2996 | 2992 | ||
2997 | memset(irq_ptr,0,sizeof(struct qdio_irq)); | ||
2998 | |||
2999 | init_MUTEX(&irq_ptr->setting_up_sema); | 2993 | init_MUTEX(&irq_ptr->setting_up_sema); |
3000 | 2994 | ||
3001 | /* QDR must be in DMA area since CCW data address is only 32 bit */ | 2995 | /* QDR must be in DMA area since CCW data address is only 32 bit */ |
@@ -3686,10 +3680,10 @@ qdio_get_qdio_memory(void) | |||
3686 | 3680 | ||
3687 | for (i=1;i<INDICATORS_PER_CACHELINE;i++) | 3681 | for (i=1;i<INDICATORS_PER_CACHELINE;i++) |
3688 | indicator_used[i]=0; | 3682 | indicator_used[i]=0; |
3689 | indicators=(__u32*)kmalloc(sizeof(__u32)*(INDICATORS_PER_CACHELINE), | 3683 | indicators = kzalloc(sizeof(__u32)*(INDICATORS_PER_CACHELINE), |
3690 | GFP_KERNEL); | 3684 | GFP_KERNEL); |
3691 | if (!indicators) return -ENOMEM; | 3685 | if (!indicators) |
3692 | memset(indicators,0,sizeof(__u32)*(INDICATORS_PER_CACHELINE)); | 3686 | return -ENOMEM; |
3693 | return 0; | 3687 | return 0; |
3694 | } | 3688 | } |
3695 | 3689 | ||