aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorSalyzyn, Mark <mark_salyzyn@adaptec.com>2007-04-16 11:21:50 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-05-06 10:33:11 -0400
commit4dbc22d7a9644088266a579433a3d621142a01e9 (patch)
tree619da605dfb99caaa50688f4c456a33145cc5c42 /drivers/scsi
parentab552204599d311988be89fe0bbbe5ea9d84184a (diff)
[SCSI] aacraid: kmalloc/memset->kzalloc
Inspired somewhat by Vignesh Babu <vignesh.babu@wipro.com> patch to dpt_i2o.c to replace kmalloc/memset sequences with kzalloc, doing the same for the aacraid driver. Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/aacraid/comminit.c3
-rw-r--r--drivers/scsi/aacraid/commsup.c6
-rw-r--r--drivers/scsi/aacraid/dpcsup.c6
3 files changed, 5 insertions, 10 deletions
diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c
index 33682ce96a5d..3009ad8c4073 100644
--- a/drivers/scsi/aacraid/comminit.c
+++ b/drivers/scsi/aacraid/comminit.c
@@ -387,12 +387,11 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
387 * Ok now init the communication subsystem 387 * Ok now init the communication subsystem
388 */ 388 */
389 389
390 dev->queues = kmalloc(sizeof(struct aac_queue_block), GFP_KERNEL); 390 dev->queues = kzalloc(sizeof(struct aac_queue_block), GFP_KERNEL);
391 if (dev->queues == NULL) { 391 if (dev->queues == NULL) {
392 printk(KERN_ERR "Error could not allocate comm region.\n"); 392 printk(KERN_ERR "Error could not allocate comm region.\n");
393 return NULL; 393 return NULL;
394 } 394 }
395 memset(dev->queues, 0, sizeof(struct aac_queue_block));
396 395
397 if (aac_comm_init(dev)<0){ 396 if (aac_comm_init(dev)<0){
398 kfree(dev->queues); 397 kfree(dev->queues);
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 5824a757a753..9aca57eda943 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -1223,13 +1223,11 @@ int aac_check_health(struct aac_dev * aac)
1223 * Warning: no sleep allowed while 1223 * Warning: no sleep allowed while
1224 * holding spinlock 1224 * holding spinlock
1225 */ 1225 */
1226 hw_fib = kmalloc(sizeof(struct hw_fib), GFP_ATOMIC); 1226 hw_fib = kzalloc(sizeof(struct hw_fib), GFP_ATOMIC);
1227 fib = kmalloc(sizeof(struct fib), GFP_ATOMIC); 1227 fib = kzalloc(sizeof(struct fib), GFP_ATOMIC);
1228 if (fib && hw_fib) { 1228 if (fib && hw_fib) {
1229 struct aac_aifcmd * aif; 1229 struct aac_aifcmd * aif;
1230 1230
1231 memset(hw_fib, 0, sizeof(struct hw_fib));
1232 memset(fib, 0, sizeof(struct fib));
1233 fib->hw_fib_va = hw_fib; 1231 fib->hw_fib_va = hw_fib;
1234 fib->dev = aac; 1232 fib->dev = aac;
1235 aac_fib_init(fib); 1233 aac_fib_init(fib);
diff --git a/drivers/scsi/aacraid/dpcsup.c b/drivers/scsi/aacraid/dpcsup.c
index 42c7dcda6d9b..fcd25f7d0bc6 100644
--- a/drivers/scsi/aacraid/dpcsup.c
+++ b/drivers/scsi/aacraid/dpcsup.c
@@ -248,16 +248,14 @@ unsigned int aac_intr_normal(struct aac_dev * dev, u32 Index)
248 * manage the linked lists. 248 * manage the linked lists.
249 */ 249 */
250 if ((!dev->aif_thread) 250 if ((!dev->aif_thread)
251 || (!(fib = kmalloc(sizeof(struct fib),GFP_ATOMIC)))) 251 || (!(fib = kzalloc(sizeof(struct fib),GFP_ATOMIC))))
252 return 1; 252 return 1;
253 if (!(hw_fib = kmalloc(sizeof(struct hw_fib),GFP_ATOMIC))) { 253 if (!(hw_fib = kzalloc(sizeof(struct hw_fib),GFP_ATOMIC))) {
254 kfree (fib); 254 kfree (fib);
255 return 1; 255 return 1;
256 } 256 }
257 memset(hw_fib, 0, sizeof(struct hw_fib));
258 memcpy(hw_fib, (struct hw_fib *)(((ptrdiff_t)(dev->regs.sa)) + 257 memcpy(hw_fib, (struct hw_fib *)(((ptrdiff_t)(dev->regs.sa)) +
259 (index & ~0x00000002L)), sizeof(struct hw_fib)); 258 (index & ~0x00000002L)), sizeof(struct hw_fib));
260 memset(fib, 0, sizeof(struct fib));
261 INIT_LIST_HEAD(&fib->fiblink); 259 INIT_LIST_HEAD(&fib->fiblink);
262 fib->type = FSAFS_NTC_FIB_CONTEXT; 260 fib->type = FSAFS_NTC_FIB_CONTEXT;
263 fib->size = sizeof(struct fib); 261 fib->size = sizeof(struct fib);