aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/cciss.c35
-rw-r--r--drivers/md/bitmap.c4
2 files changed, 20 insertions, 19 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 14d780666c0a..65a725cd3422 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -3423,6 +3423,25 @@ static void cciss_remove_one(struct pci_dev *pdev)
3423 "already be removed \n"); 3423 "already be removed \n");
3424 return; 3424 return;
3425 } 3425 }
3426
3427 remove_proc_entry(hba[i]->devname, proc_cciss);
3428 unregister_blkdev(hba[i]->major, hba[i]->devname);
3429
3430 /* remove it from the disk list */
3431 for (j = 0; j < CISS_MAX_LUN; j++) {
3432 struct gendisk *disk = hba[i]->gendisk[j];
3433 if (disk) {
3434 request_queue_t *q = disk->queue;
3435
3436 if (disk->flags & GENHD_FL_UP)
3437 del_gendisk(disk);
3438 if (q)
3439 blk_cleanup_queue(q);
3440 }
3441 }
3442
3443 cciss_unregister_scsi(i); /* unhook from SCSI subsystem */
3444
3426 /* Turn board interrupts off and send the flush cache command */ 3445 /* Turn board interrupts off and send the flush cache command */
3427 /* sendcmd will turn off interrupt, and send the flush... 3446 /* sendcmd will turn off interrupt, and send the flush...
3428 * To write all data in the battery backed cache to disks */ 3447 * To write all data in the battery backed cache to disks */
@@ -3444,22 +3463,6 @@ static void cciss_remove_one(struct pci_dev *pdev)
3444#endif /* CONFIG_PCI_MSI */ 3463#endif /* CONFIG_PCI_MSI */
3445 3464
3446 iounmap(hba[i]->vaddr); 3465 iounmap(hba[i]->vaddr);
3447 cciss_unregister_scsi(i); /* unhook from SCSI subsystem */
3448 unregister_blkdev(hba[i]->major, hba[i]->devname);
3449 remove_proc_entry(hba[i]->devname, proc_cciss);
3450
3451 /* remove it from the disk list */
3452 for (j = 0; j < CISS_MAX_LUN; j++) {
3453 struct gendisk *disk = hba[i]->gendisk[j];
3454 if (disk) {
3455 request_queue_t *q = disk->queue;
3456
3457 if (disk->flags & GENHD_FL_UP)
3458 del_gendisk(disk);
3459 if (q)
3460 blk_cleanup_queue(q);
3461 }
3462 }
3463 3466
3464 pci_free_consistent(hba[i]->pdev, hba[i]->nr_cmds * sizeof(CommandList_struct), 3467 pci_free_consistent(hba[i]->pdev, hba[i]->nr_cmds * sizeof(CommandList_struct),
3465 hba[i]->cmd_pool, hba[i]->cmd_pool_dhandle); 3468 hba[i]->cmd_pool, hba[i]->cmd_pool_dhandle);
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 5554adaa58f9..e61e0efe9ec7 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -863,9 +863,7 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start)
863 863
864 /* We need 4 bits per page, rounded up to a multiple of sizeof(unsigned long) */ 864 /* We need 4 bits per page, rounded up to a multiple of sizeof(unsigned long) */
865 bitmap->filemap_attr = kzalloc( 865 bitmap->filemap_attr = kzalloc(
866 (((num_pages*4/8)+sizeof(unsigned long)-1) 866 roundup( DIV_ROUND_UP(num_pages*4, 8), sizeof(unsigned long)),
867 /sizeof(unsigned long))
868 *sizeof(unsigned long),
869 GFP_KERNEL); 867 GFP_KERNEL);
870 if (!bitmap->filemap_attr) 868 if (!bitmap->filemap_attr)
871 goto out; 869 goto out;