]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/pluto.c
revert sg segment size ifdefs
[linux-2.6-omap-h63xx.git] / drivers / scsi / pluto.c
index d953d43fe2e6146e62ab43ee392d3a3c0df0c2af..0363c1cd68c1faa310ec06f64f16fc6e41a8004f 100644 (file)
@@ -111,13 +111,12 @@ int __init pluto_detect(struct scsi_host_template *tpnt)
 #endif
                        return 0;
        }
-       fcs = kmalloc(sizeof (struct ctrl_inquiry) * fcscount, GFP_DMA);
+       fcs = kcalloc(fcscount, sizeof (struct ctrl_inquiry), GFP_DMA);
        if (!fcs) {
                printk ("PLUTO: Not enough memory to probe\n");
                return 0;
        }
        
-       memset (fcs, 0, sizeof (struct ctrl_inquiry) * fcscount);
        memset (&dev, 0, sizeof(dev));
        atomic_set (&fcss, fcscount);
        
@@ -161,7 +160,6 @@ int __init pluto_detect(struct scsi_host_template *tpnt)
        
                SCpnt->request->cmd_flags &= ~REQ_STARTED;
                
-               SCpnt->done = pluto_detect_done;
                SCpnt->request_bufflen = 256;
                SCpnt->request_buffer = fcs[i].inquiry;
                PLD(("set up %d %08lx\n", i, (long)SCpnt))
@@ -196,7 +194,7 @@ int __init pluto_detect(struct scsi_host_template *tpnt)
                SCpnt = &(fcs[i].cmd);
                
                /* Let FC mid-level free allocated resources */
-               SCpnt->done (SCpnt);
+               pluto_detect_scsi_done(SCpnt);
                
                if (!SCpnt->result) {
                        struct pluto_inquiry *inq;
@@ -211,7 +209,7 @@ int __init pluto_detect(struct scsi_host_template *tpnt)
                                char *p;
                                long *ages;
                                
-                               ages = kmalloc (((inq->channels + 1) * inq->targets) * sizeof(long), GFP_KERNEL);
+                               ages = kcalloc((inq->channels + 1) * inq->targets, sizeof(long), GFP_KERNEL);
                                if (!ages) continue;
                                
                                host = scsi_register (tpnt, sizeof (struct pluto));
@@ -238,7 +236,6 @@ int __init pluto_detect(struct scsi_host_template *tpnt)
                                fc->channels = inq->channels + 1;
                                fc->targets = inq->targets;
                                fc->ages = ages;
-                               memset (ages, 0, ((inq->channels + 1) * inq->targets) * sizeof(long));
                                
                                pluto->fc = fc;
                                memcpy (pluto->rev_str, inq->revision, 4);
@@ -260,7 +257,7 @@ int __init pluto_detect(struct scsi_host_template *tpnt)
                } else
                        fc->fcp_register(fc, TYPE_SCSI_FCP, 1);
        }
-       kfree((char *)fcs);
+       kfree(fcs);
        if (nplutos)
                printk ("PLUTO: Total of %d SparcSTORAGE Arrays found\n", nplutos);
        return nplutos;