[SCSI] aacraid: kmalloc/memset->kzalloc
authorSalyzyn, Mark <mark_salyzyn@adaptec.com>
Mon, 16 Apr 2007 15:21:50 +0000 (11:21 -0400)
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>
Sun, 6 May 2007 14:33:11 +0000 (09:33 -0500)
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>
drivers/scsi/aacraid/comminit.c
drivers/scsi/aacraid/commsup.c
drivers/scsi/aacraid/dpcsup.c

index 33682ce96a5d683cdc9d6e2687b2e95eaee43f20..3009ad8c407343d209e9b4d0a79639f0dbbfd4fe 100644 (file)
@@ -387,12 +387,11 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
         *      Ok now init the communication subsystem
         */
 
-       dev->queues = kmalloc(sizeof(struct aac_queue_block), GFP_KERNEL);
+       dev->queues = kzalloc(sizeof(struct aac_queue_block), GFP_KERNEL);
        if (dev->queues == NULL) {
                printk(KERN_ERR "Error could not allocate comm region.\n");
                return NULL;
        }
-       memset(dev->queues, 0, sizeof(struct aac_queue_block));
 
        if (aac_comm_init(dev)<0){
                kfree(dev->queues);
index 5824a757a7531aa9d71801486754cee84027a3f1..9aca57eda943664011d06863c309fd4178a58622 100644 (file)
@@ -1223,13 +1223,11 @@ int aac_check_health(struct aac_dev * aac)
                 * Warning: no sleep allowed while
                 * holding spinlock
                 */
-               hw_fib = kmalloc(sizeof(struct hw_fib), GFP_ATOMIC);
-               fib = kmalloc(sizeof(struct fib), GFP_ATOMIC);
+               hw_fib = kzalloc(sizeof(struct hw_fib), GFP_ATOMIC);
+               fib = kzalloc(sizeof(struct fib), GFP_ATOMIC);
                if (fib && hw_fib) {
                        struct aac_aifcmd * aif;
 
-                       memset(hw_fib, 0, sizeof(struct hw_fib));
-                       memset(fib, 0, sizeof(struct fib));
                        fib->hw_fib_va = hw_fib;
                        fib->dev = aac;
                        aac_fib_init(fib);
index 42c7dcda6d9bd1c9679cddcc8dd01bb0be00ae4c..fcd25f7d0bc636252074d535338d3c9f9e2e81f0 100644 (file)
@@ -248,16 +248,14 @@ unsigned int aac_intr_normal(struct aac_dev * dev, u32 Index)
                 * manage the linked lists.
                 */
                if ((!dev->aif_thread)
-                || (!(fib = kmalloc(sizeof(struct fib),GFP_ATOMIC))))
+                || (!(fib = kzalloc(sizeof(struct fib),GFP_ATOMIC))))
                        return 1;
-               if (!(hw_fib = kmalloc(sizeof(struct hw_fib),GFP_ATOMIC))) {
+               if (!(hw_fib = kzalloc(sizeof(struct hw_fib),GFP_ATOMIC))) {
                        kfree (fib);
                        return 1;
                }
-               memset(hw_fib, 0, sizeof(struct hw_fib));
                memcpy(hw_fib, (struct hw_fib *)(((ptrdiff_t)(dev->regs.sa)) +
                  (index & ~0x00000002L)), sizeof(struct hw_fib));
-               memset(fib, 0, sizeof(struct fib));
                INIT_LIST_HEAD(&fib->fiblink);
                fib->type = FSAFS_NTC_FIB_CONTEXT;
                fib->size = sizeof(struct fib);