[PATCH] More BUG_ON conversion
[linux-2.6-block.git] / drivers / ide / ide.c
index afeb02bbb72210b4ee45bbcf6c6ed5e4a0cd416c..9799aed772e126c6d868a87cfaae6d579284951d 100644 (file)
@@ -242,7 +242,6 @@ static void init_hwif_data(ide_hwif_t *hwif, unsigned int index)
                drive->name[2]                  = 'a' + (index * MAX_DRIVES) + unit;
                drive->max_failures             = IDE_DEFAULT_MAX_FAILURES;
                drive->using_dma                = 0;
-               drive->is_flash                 = 0;
                drive->vdma                     = 0;
                INIT_LIST_HEAD(&drive->list);
                init_completion(&drive->gendev_rel_comp);
@@ -727,6 +726,7 @@ void ide_setup_ports (      hw_regs_t *hw,
 {
        int i;
 
+       memset(hw, 0, sizeof(hw_regs_t));
        for (i = 0; i < IDE_NR_PORTS; i++) {
                if (offsets[i] == -1) {
                        switch(i) {
@@ -1367,8 +1367,7 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device
 
                        ide_abort(drive, "drive reset");
 
-                       if(HWGROUP(drive)->handler)
-                               BUG();
+                       BUG_ON(HWGROUP(drive)->handler);
                                
                        /* Ensure nothing gets queued after we
                           drop the lock. Reset will clear the busy */
@@ -2059,7 +2058,7 @@ static void __init parse_options (char *line)
        }
 }
 
-int init_module (void)
+int __init init_module (void)
 {
        parse_options(options);
        return ide_init();