diff options
author | Mariusz Kozlowski <m.kozlowski@tuxland.pl> | 2007-08-11 04:13:24 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.localdomain> | 2007-10-12 14:41:00 -0400 |
commit | bbfbbbc1182f8b44c8cc4c99f4a3f3a512149022 (patch) | |
tree | f7e3d50cda2e3d55bff88c2cc617d60df8ddb2cb /drivers/scsi/pluto.c | |
parent | f36789e22ac32a6554b8e4d05ab6125fc1161745 (diff) |
[SCSI] kmalloc + memset conversion to kzalloc
In NCR_D700, a4000t, aic7xxx_old, bvme6000, dpt_i2o, gdth, lpfc,
megaraid, mvme16x osst, pluto, qla2xxx, zorro7xx
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/pluto.c')
-rw-r--r-- | drivers/scsi/pluto.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/scsi/pluto.c b/drivers/scsi/pluto.c index d953d43fe2e6..e2213894917f 100644 --- a/drivers/scsi/pluto.c +++ b/drivers/scsi/pluto.c | |||
@@ -111,13 +111,12 @@ int __init pluto_detect(struct scsi_host_template *tpnt) | |||
111 | #endif | 111 | #endif |
112 | return 0; | 112 | return 0; |
113 | } | 113 | } |
114 | fcs = kmalloc(sizeof (struct ctrl_inquiry) * fcscount, GFP_DMA); | 114 | fcs = kcalloc(fcscount, sizeof (struct ctrl_inquiry), GFP_DMA); |
115 | if (!fcs) { | 115 | if (!fcs) { |
116 | printk ("PLUTO: Not enough memory to probe\n"); | 116 | printk ("PLUTO: Not enough memory to probe\n"); |
117 | return 0; | 117 | return 0; |
118 | } | 118 | } |
119 | 119 | ||
120 | memset (fcs, 0, sizeof (struct ctrl_inquiry) * fcscount); | ||
121 | memset (&dev, 0, sizeof(dev)); | 120 | memset (&dev, 0, sizeof(dev)); |
122 | atomic_set (&fcss, fcscount); | 121 | atomic_set (&fcss, fcscount); |
123 | 122 | ||
@@ -211,7 +210,7 @@ int __init pluto_detect(struct scsi_host_template *tpnt) | |||
211 | char *p; | 210 | char *p; |
212 | long *ages; | 211 | long *ages; |
213 | 212 | ||
214 | ages = kmalloc (((inq->channels + 1) * inq->targets) * sizeof(long), GFP_KERNEL); | 213 | ages = kcalloc((inq->channels + 1) * inq->targets, sizeof(long), GFP_KERNEL); |
215 | if (!ages) continue; | 214 | if (!ages) continue; |
216 | 215 | ||
217 | host = scsi_register (tpnt, sizeof (struct pluto)); | 216 | host = scsi_register (tpnt, sizeof (struct pluto)); |
@@ -238,7 +237,6 @@ int __init pluto_detect(struct scsi_host_template *tpnt) | |||
238 | fc->channels = inq->channels + 1; | 237 | fc->channels = inq->channels + 1; |
239 | fc->targets = inq->targets; | 238 | fc->targets = inq->targets; |
240 | fc->ages = ages; | 239 | fc->ages = ages; |
241 | memset (ages, 0, ((inq->channels + 1) * inq->targets) * sizeof(long)); | ||
242 | 240 | ||
243 | pluto->fc = fc; | 241 | pluto->fc = fc; |
244 | memcpy (pluto->rev_str, inq->revision, 4); | 242 | memcpy (pluto->rev_str, inq->revision, 4); |
@@ -260,7 +258,7 @@ int __init pluto_detect(struct scsi_host_template *tpnt) | |||
260 | } else | 258 | } else |
261 | fc->fcp_register(fc, TYPE_SCSI_FCP, 1); | 259 | fc->fcp_register(fc, TYPE_SCSI_FCP, 1); |
262 | } | 260 | } |
263 | kfree((char *)fcs); | 261 | kfree(fcs); |
264 | if (nplutos) | 262 | if (nplutos) |
265 | printk ("PLUTO: Total of %d SparcSTORAGE Arrays found\n", nplutos); | 263 | printk ("PLUTO: Total of %d SparcSTORAGE Arrays found\n", nplutos); |
266 | return nplutos; | 264 | return nplutos; |