aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/net/qeth_main.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/net/qeth_main.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/net/qeth_main.c')
-rw-r--r--drivers/s390/net/qeth_main.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
index 021cd5d08c61..b3c6e7907790 100644
--- a/drivers/s390/net/qeth_main.c
+++ b/drivers/s390/net/qeth_main.c
@@ -297,12 +297,10 @@ qeth_alloc_card(void)
297 struct qeth_card *card; 297 struct qeth_card *card;
298 298
299 QETH_DBF_TEXT(setup, 2, "alloccrd"); 299 QETH_DBF_TEXT(setup, 2, "alloccrd");
300 card = (struct qeth_card *) kmalloc(sizeof(struct qeth_card), 300 card = kzalloc(sizeof(struct qeth_card), GFP_DMA|GFP_KERNEL);
301 GFP_DMA|GFP_KERNEL);
302 if (!card) 301 if (!card)
303 return NULL; 302 return NULL;
304 QETH_DBF_HEX(setup, 2, &card, sizeof(void *)); 303 QETH_DBF_HEX(setup, 2, &card, sizeof(void *));
305 memset(card, 0, sizeof(struct qeth_card));
306 if (qeth_setup_channel(&card->read)) { 304 if (qeth_setup_channel(&card->read)) {
307 kfree(card); 305 kfree(card);
308 return NULL; 306 return NULL;
@@ -1632,9 +1630,8 @@ qeth_alloc_reply(struct qeth_card *card)
1632{ 1630{
1633 struct qeth_reply *reply; 1631 struct qeth_reply *reply;
1634 1632
1635 reply = kmalloc(sizeof(struct qeth_reply), GFP_ATOMIC); 1633 reply = kzalloc(sizeof(struct qeth_reply), GFP_ATOMIC);
1636 if (reply){ 1634 if (reply){
1637 memset(reply, 0, sizeof(struct qeth_reply));
1638 atomic_set(&reply->refcnt, 1); 1635 atomic_set(&reply->refcnt, 1);
1639 reply->card = card; 1636 reply->card = card;
1640 }; 1637 };
@@ -3348,13 +3345,11 @@ qeth_qdio_establish(struct qeth_card *card)
3348 3345
3349 QETH_DBF_TEXT(setup, 2, "qdioest"); 3346 QETH_DBF_TEXT(setup, 2, "qdioest");
3350 3347
3351 qib_param_field = kmalloc(QDIO_MAX_BUFFERS_PER_Q * sizeof(char), 3348 qib_param_field = kzalloc(QDIO_MAX_BUFFERS_PER_Q * sizeof(char),
3352 GFP_KERNEL); 3349 GFP_KERNEL);
3353 if (!qib_param_field) 3350 if (!qib_param_field)
3354 return -ENOMEM; 3351 return -ENOMEM;
3355 3352
3356 memset(qib_param_field, 0, QDIO_MAX_BUFFERS_PER_Q * sizeof(char));
3357
3358 qeth_create_qib_param_field(card, qib_param_field); 3353 qeth_create_qib_param_field(card, qib_param_field);
3359 qeth_create_qib_param_field_blkt(card, qib_param_field); 3354 qeth_create_qib_param_field_blkt(card, qib_param_field);
3360 3355
@@ -4819,9 +4814,8 @@ qeth_arp_query(struct qeth_card *card, char *udata)
4819 /* get size of userspace buffer and mask_bits -> 6 bytes */ 4814 /* get size of userspace buffer and mask_bits -> 6 bytes */
4820 if (copy_from_user(&qinfo, udata, 6)) 4815 if (copy_from_user(&qinfo, udata, 6))
4821 return -EFAULT; 4816 return -EFAULT;
4822 if (!(qinfo.udata = kmalloc(qinfo.udata_len, GFP_KERNEL))) 4817 if (!(qinfo.udata = kzalloc(qinfo.udata_len, GFP_KERNEL)))
4823 return -ENOMEM; 4818 return -ENOMEM;
4824 memset(qinfo.udata, 0, qinfo.udata_len);
4825 qinfo.udata_offset = QETH_QARP_ENTRIES_OFFSET; 4819 qinfo.udata_offset = QETH_QARP_ENTRIES_OFFSET;
4826 iob = qeth_get_setassparms_cmd(card, IPA_ARP_PROCESSING, 4820 iob = qeth_get_setassparms_cmd(card, IPA_ARP_PROCESSING,
4827 IPA_CMD_ASS_ARP_QUERY_INFO, 4821 IPA_CMD_ASS_ARP_QUERY_INFO,
@@ -4969,11 +4963,10 @@ qeth_snmp_command(struct qeth_card *card, char *udata)
4969 return -EFAULT; 4963 return -EFAULT;
4970 } 4964 }
4971 qinfo.udata_len = ureq->hdr.data_len; 4965 qinfo.udata_len = ureq->hdr.data_len;
4972 if (!(qinfo.udata = kmalloc(qinfo.udata_len, GFP_KERNEL))){ 4966 if (!(qinfo.udata = kzalloc(qinfo.udata_len, GFP_KERNEL))){
4973 kfree(ureq); 4967 kfree(ureq);
4974 return -ENOMEM; 4968 return -ENOMEM;
4975 } 4969 }
4976 memset(qinfo.udata, 0, qinfo.udata_len);
4977 qinfo.udata_offset = sizeof(struct qeth_snmp_ureq_hdr); 4970 qinfo.udata_offset = sizeof(struct qeth_snmp_ureq_hdr);
4978 4971
4979 iob = qeth_get_adapter_cmd(card, IPA_SETADP_SET_SNMP_CONTROL, 4972 iob = qeth_get_adapter_cmd(card, IPA_SETADP_SET_SNMP_CONTROL,
@@ -5564,12 +5557,11 @@ qeth_get_addr_buffer(enum qeth_prot_versions prot)
5564{ 5557{
5565 struct qeth_ipaddr *addr; 5558 struct qeth_ipaddr *addr;
5566 5559
5567 addr = kmalloc(sizeof(struct qeth_ipaddr), GFP_ATOMIC); 5560 addr = kzalloc(sizeof(struct qeth_ipaddr), GFP_ATOMIC);
5568 if (addr == NULL) { 5561 if (addr == NULL) {
5569 PRINT_WARN("Not enough memory to add address\n"); 5562 PRINT_WARN("Not enough memory to add address\n");
5570 return NULL; 5563 return NULL;
5571 } 5564 }
5572 memset(addr,0,sizeof(struct qeth_ipaddr));
5573 addr->type = QETH_IP_TYPE_NORMAL; 5565 addr->type = QETH_IP_TYPE_NORMAL;
5574 addr->proto = prot; 5566 addr->proto = prot;
5575 return addr; 5567 return addr;