[PATCH] getting rid of all casts of k[cmz]alloc() calls
[linux-2.6-block.git] / drivers / block / cciss.c
index c99cb7ed57f728ae9b543940ffe1f33509485380..acb2fa9cf6b1a161c77ac61e3603699333f9f143 100644 (file)
@@ -535,7 +535,7 @@ static int do_ioctl(struct file *f, unsigned cmd, unsigned long arg)
 {
        int ret;
        lock_kernel();
-       ret = cciss_ioctl(f->f_dentry->d_inode, f, cmd, arg);
+       ret = cciss_ioctl(f->f_path.dentry->d_inode, f, cmd, arg);
        unlock_kernel();
        return ret;
 }
@@ -1039,7 +1039,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
                                status = -ENOMEM;
                                goto cleanup1;
                        }
-                       buff_size = (int *)kmalloc(MAXSGENTRIES * sizeof(int),
+                       buff_size = kmalloc(MAXSGENTRIES * sizeof(int),
                                                   GFP_KERNEL);
                        if (!buff_size) {
                                status = -ENOMEM;
@@ -2788,23 +2788,21 @@ static void __devinit cciss_interrupt_mode(ctlr_info_t *c,
                if (err > 0) {
                        printk(KERN_WARNING "cciss: only %d MSI-X vectors "
                               "available\n", err);
+                       goto default_int_mode;
                } else {
                        printk(KERN_WARNING "cciss: MSI-X init failed %d\n",
                               err);
+                       goto default_int_mode;
                }
        }
        if (pci_find_capability(pdev, PCI_CAP_ID_MSI)) {
                if (!pci_enable_msi(pdev)) {
-                       c->intr[SIMPLE_MODE_INT] = pdev->irq;
                        c->msi_vector = 1;
-                       return;
                } else {
                        printk(KERN_WARNING "cciss: MSI init failed\n");
-                       c->intr[SIMPLE_MODE_INT] = pdev->irq;
-                       return;
                }
        }
-      default_int_mode:
+default_int_mode:
 #endif                         /* CONFIG_PCI_MSI */
        /* if we get here we're going to use the default interrupt mode */
        c->intr[SIMPLE_MODE_INT] = pdev->irq;
@@ -2839,7 +2837,7 @@ static int cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
        if (err) {
                printk(KERN_ERR "cciss: Cannot obtain PCI resources, "
                       "aborting\n");
-               goto err_out_disable_pdev;
+               return err;
        }
 
        subsystem_vendor_id = pdev->subsystem_vendor;
@@ -2867,7 +2865,7 @@ static int cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
 #ifdef CCISS_DEBUG
        printk("address 0 = %x\n", c->paddr);
 #endif                         /* CCISS_DEBUG */
-       c->vaddr = remap_pci_mem(c->paddr, 200);
+       c->vaddr = remap_pci_mem(c->paddr, 0x250);
 
        /* Wait for the board to become ready.  (PCI hotplug needs this.)
         * We poll for up to 120 secs, once per 100ms. */
@@ -3007,10 +3005,11 @@ static int cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
        return 0;
 
       err_out_free_res:
+       /*
+        * Deliberately omit pci_disable_device(): it does something nasty to
+        * Smart Array controllers that pci_enable_device does not undo
+        */
        pci_release_regions(pdev);
-
-      err_out_disable_pdev:
-       pci_disable_device(pdev);
        return err;
 }
 
@@ -3384,8 +3383,11 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
                if (drv->queue)
                        blk_cleanup_queue(drv->queue);
        }
+       /*
+        * Deliberately omit pci_disable_device(): it does something nasty to
+        * Smart Array controllers that pci_enable_device does not undo
+        */
        pci_release_regions(pdev);
-       pci_disable_device(pdev);
        pci_set_drvdata(pdev, NULL);
        free_hba(i);
        return -1;
@@ -3454,8 +3456,11 @@ static void __devexit cciss_remove_one(struct pci_dev *pdev)
 #ifdef CONFIG_CISS_SCSI_TAPE
        kfree(hba[i]->scsi_rejects.complete);
 #endif
+       /*
+        * Deliberately omit pci_disable_device(): it does something nasty to
+        * Smart Array controllers that pci_enable_device does not undo
+        */
        pci_release_regions(pdev);
-       pci_disable_device(pdev);
        pci_set_drvdata(pdev, NULL);
        free_hba(i);
 }