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/crypto | |
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/crypto')
-rw-r--r-- | drivers/s390/crypto/z90main.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/s390/crypto/z90main.c b/drivers/s390/crypto/z90main.c index 977ecd9ba6bd..982acc7303ea 100644 --- a/drivers/s390/crypto/z90main.c +++ b/drivers/s390/crypto/z90main.c | |||
@@ -707,13 +707,12 @@ z90crypt_open(struct inode *inode, struct file *filp) | |||
707 | if (quiesce_z90crypt) | 707 | if (quiesce_z90crypt) |
708 | return -EQUIESCE; | 708 | return -EQUIESCE; |
709 | 709 | ||
710 | private_data_p = kmalloc(sizeof(struct priv_data), GFP_KERNEL); | 710 | private_data_p = kzalloc(sizeof(struct priv_data), GFP_KERNEL); |
711 | if (!private_data_p) { | 711 | if (!private_data_p) { |
712 | PRINTK("Memory allocate failed\n"); | 712 | PRINTK("Memory allocate failed\n"); |
713 | return -ENOMEM; | 713 | return -ENOMEM; |
714 | } | 714 | } |
715 | 715 | ||
716 | memset((void *)private_data_p, 0, sizeof(struct priv_data)); | ||
717 | private_data_p->status = STAT_OPEN; | 716 | private_data_p->status = STAT_OPEN; |
718 | private_data_p->opener_pid = PID(); | 717 | private_data_p->opener_pid = PID(); |
719 | filp->private_data = private_data_p; | 718 | filp->private_data = private_data_p; |
@@ -2737,13 +2736,11 @@ create_z90crypt(int *cdx_p) | |||
2737 | z90crypt.max_count = Z90CRYPT_NUM_DEVS; | 2736 | z90crypt.max_count = Z90CRYPT_NUM_DEVS; |
2738 | z90crypt.cdx = *cdx_p; | 2737 | z90crypt.cdx = *cdx_p; |
2739 | 2738 | ||
2740 | hdware_blk_p = (struct hdware_block *) | 2739 | hdware_blk_p = kzalloc(sizeof(struct hdware_block), GFP_ATOMIC); |
2741 | kmalloc(sizeof(struct hdware_block), GFP_ATOMIC); | ||
2742 | if (!hdware_blk_p) { | 2740 | if (!hdware_blk_p) { |
2743 | PDEBUG("kmalloc for hardware block failed\n"); | 2741 | PDEBUG("kmalloc for hardware block failed\n"); |
2744 | return ENOMEM; | 2742 | return ENOMEM; |
2745 | } | 2743 | } |
2746 | memset(hdware_blk_p, 0x00, sizeof(struct hdware_block)); | ||
2747 | z90crypt.hdware_info = hdware_blk_p; | 2744 | z90crypt.hdware_info = hdware_blk_p; |
2748 | 2745 | ||
2749 | return 0; | 2746 | return 0; |
@@ -2978,12 +2975,11 @@ create_crypto_device(int index) | |||
2978 | total_size = sizeof(struct device) + | 2975 | total_size = sizeof(struct device) + |
2979 | z90crypt.q_depth_array[index] * sizeof(int); | 2976 | z90crypt.q_depth_array[index] * sizeof(int); |
2980 | 2977 | ||
2981 | dev_ptr = (struct device *) kmalloc(total_size, GFP_ATOMIC); | 2978 | dev_ptr = kzalloc(total_size, GFP_ATOMIC); |
2982 | if (!dev_ptr) { | 2979 | if (!dev_ptr) { |
2983 | PRINTK("kmalloc device %d failed\n", index); | 2980 | PRINTK("kmalloc device %d failed\n", index); |
2984 | return ENOMEM; | 2981 | return ENOMEM; |
2985 | } | 2982 | } |
2986 | memset(dev_ptr, 0, total_size); | ||
2987 | dev_ptr->dev_resp_p = kmalloc(MAX_RESPONSE_SIZE, GFP_ATOMIC); | 2983 | dev_ptr->dev_resp_p = kmalloc(MAX_RESPONSE_SIZE, GFP_ATOMIC); |
2988 | if (!dev_ptr->dev_resp_p) { | 2984 | if (!dev_ptr->dev_resp_p) { |
2989 | kfree(dev_ptr); | 2985 | kfree(dev_ptr); |