diff options
author | Christoph Hellwig <hch@lst.de> | 2006-01-13 12:27:50 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2006-01-14 11:54:58 -0500 |
commit | 1ca00bb7916cb40b8140173c23481e11d92d6f6a (patch) | |
tree | e5a16f6f230556ce43f77139c729f09a16ec95fb /drivers/message/fusion/mptlan.c | |
parent | eeb846cefdd842af479393a7d0fd399a29e42532 (diff) |
[SCSI] fusion: kzalloc / kcalloc conversion
Convert kmalloc + memset to kzalloc or kcalloc in fusion.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/message/fusion/mptlan.c')
-rw-r--r-- | drivers/message/fusion/mptlan.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/message/fusion/mptlan.c b/drivers/message/fusion/mptlan.c index 014085d8ec85..0b1b72825ae2 100644 --- a/drivers/message/fusion/mptlan.c +++ b/drivers/message/fusion/mptlan.c | |||
@@ -411,14 +411,12 @@ mpt_lan_open(struct net_device *dev) | |||
411 | goto out; | 411 | goto out; |
412 | priv->mpt_txfidx_tail = -1; | 412 | priv->mpt_txfidx_tail = -1; |
413 | 413 | ||
414 | priv->SendCtl = kmalloc(priv->tx_max_out * sizeof(struct BufferControl), | 414 | priv->SendCtl = kcalloc(priv->tx_max_out, sizeof(struct BufferControl), |
415 | GFP_KERNEL); | 415 | GFP_KERNEL); |
416 | if (priv->SendCtl == NULL) | 416 | if (priv->SendCtl == NULL) |
417 | goto out_mpt_txfidx; | 417 | goto out_mpt_txfidx; |
418 | for (i = 0; i < priv->tx_max_out; i++) { | 418 | for (i = 0; i < priv->tx_max_out; i++) |
419 | memset(&priv->SendCtl[i], 0, sizeof(struct BufferControl)); | ||
420 | priv->mpt_txfidx[++priv->mpt_txfidx_tail] = i; | 419 | priv->mpt_txfidx[++priv->mpt_txfidx_tail] = i; |
421 | } | ||
422 | 420 | ||
423 | dlprintk((KERN_INFO MYNAM "@lo: Finished initializing SendCtl\n")); | 421 | dlprintk((KERN_INFO MYNAM "@lo: Finished initializing SendCtl\n")); |
424 | 422 | ||
@@ -428,15 +426,13 @@ mpt_lan_open(struct net_device *dev) | |||
428 | goto out_SendCtl; | 426 | goto out_SendCtl; |
429 | priv->mpt_rxfidx_tail = -1; | 427 | priv->mpt_rxfidx_tail = -1; |
430 | 428 | ||
431 | priv->RcvCtl = kmalloc(priv->max_buckets_out * | 429 | priv->RcvCtl = kcalloc(priv->max_buckets_out, |
432 | sizeof(struct BufferControl), | 430 | sizeof(struct BufferControl), |
433 | GFP_KERNEL); | 431 | GFP_KERNEL); |
434 | if (priv->RcvCtl == NULL) | 432 | if (priv->RcvCtl == NULL) |
435 | goto out_mpt_rxfidx; | 433 | goto out_mpt_rxfidx; |
436 | for (i = 0; i < priv->max_buckets_out; i++) { | 434 | for (i = 0; i < priv->max_buckets_out; i++) |
437 | memset(&priv->RcvCtl[i], 0, sizeof(struct BufferControl)); | ||
438 | priv->mpt_rxfidx[++priv->mpt_rxfidx_tail] = i; | 435 | priv->mpt_rxfidx[++priv->mpt_rxfidx_tail] = i; |
439 | } | ||
440 | 436 | ||
441 | /**/ dlprintk((KERN_INFO MYNAM "/lo: txfidx contains - ")); | 437 | /**/ dlprintk((KERN_INFO MYNAM "/lo: txfidx contains - ")); |
442 | /**/ for (i = 0; i < priv->tx_max_out; i++) | 438 | /**/ for (i = 0; i < priv->tx_max_out; i++) |