diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2006-11-17 20:01:52 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-02 00:16:37 -0500 |
commit | cbee9f9115da7eac5dc44a450f2dab343236cb2c (patch) | |
tree | 9aa55714dce5fd297a6b83fa304a6986b6972bdb /drivers/net/chelsio | |
parent | 86c27d275507d81da179b571f35d34df61f7c6d3 (diff) |
[PATCH] chelsio: use kzalloc
Use kzalloc() in chelsio driver.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/chelsio')
-rw-r--r-- | drivers/net/chelsio/sge.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c index 11c70b59a1a3..9fb77c6d6c6b 100644 --- a/drivers/net/chelsio/sge.c +++ b/drivers/net/chelsio/sge.c | |||
@@ -335,10 +335,9 @@ static int alloc_rx_resources(struct sge *sge, struct sge_params *p) | |||
335 | goto err_no_mem; | 335 | goto err_no_mem; |
336 | memset(q->entries, 0, size); | 336 | memset(q->entries, 0, size); |
337 | size = sizeof(struct freelQ_ce) * q->size; | 337 | size = sizeof(struct freelQ_ce) * q->size; |
338 | q->centries = kmalloc(size, GFP_KERNEL); | 338 | q->centries = kzalloc(size, GFP_KERNEL); |
339 | if (!q->centries) | 339 | if (!q->centries) |
340 | goto err_no_mem; | 340 | goto err_no_mem; |
341 | memset(q->centries, 0, size); | ||
342 | } | 341 | } |
343 | 342 | ||
344 | /* | 343 | /* |
@@ -463,10 +462,9 @@ static int alloc_tx_resources(struct sge *sge, struct sge_params *p) | |||
463 | goto err_no_mem; | 462 | goto err_no_mem; |
464 | memset(q->entries, 0, size); | 463 | memset(q->entries, 0, size); |
465 | size = sizeof(struct cmdQ_ce) * q->size; | 464 | size = sizeof(struct cmdQ_ce) * q->size; |
466 | q->centries = kmalloc(size, GFP_KERNEL); | 465 | q->centries = kzalloc(size, GFP_KERNEL); |
467 | if (!q->centries) | 466 | if (!q->centries) |
468 | goto err_no_mem; | 467 | goto err_no_mem; |
469 | memset(q->centries, 0, size); | ||
470 | } | 468 | } |
471 | 469 | ||
472 | /* | 470 | /* |
@@ -1635,11 +1633,10 @@ static void espibug_workaround(void *data) | |||
1635 | struct sge * __devinit t1_sge_create(struct adapter *adapter, | 1633 | struct sge * __devinit t1_sge_create(struct adapter *adapter, |
1636 | struct sge_params *p) | 1634 | struct sge_params *p) |
1637 | { | 1635 | { |
1638 | struct sge *sge = kmalloc(sizeof(*sge), GFP_KERNEL); | 1636 | struct sge *sge = kzalloc(sizeof(*sge), GFP_KERNEL); |
1639 | 1637 | ||
1640 | if (!sge) | 1638 | if (!sge) |
1641 | return NULL; | 1639 | return NULL; |
1642 | memset(sge, 0, sizeof(*sge)); | ||
1643 | 1640 | ||
1644 | sge->adapter = adapter; | 1641 | sge->adapter = adapter; |
1645 | sge->netdev = adapter->port[0].dev; | 1642 | sge->netdev = adapter->port[0].dev; |