]> err.no Git - linux-2.6/blobdiff - drivers/ide/ide-lib.c
Merge master.kernel.org:/home/rmk/linux-2.6-arm
[linux-2.6] / drivers / ide / ide-lib.c
index b09a6537c7a8a9b2d975026b38d4edcae53757d5..7ddb11828731e816ea9c6acafe382906bb0b81a5 100644 (file)
@@ -164,8 +164,7 @@ u8 ide_rate_filter (u8 mode, u8 speed)
 //     printk("%s: mode 0x%02x, speed 0x%02x\n", __FUNCTION__, mode, speed);
 
        /* So that we remember to update this if new modes appear */
-       if (mode > 4)
-               BUG();
+       BUG_ON(mode > 4);
        return min(speed, speed_max[mode]);
 #else /* !CONFIG_BLK_DEV_IDEDMA */
        return min(speed, (u8)XFER_PIO_4);
@@ -410,10 +409,10 @@ void ide_toggle_bounce(ide_drive_t *drive, int on)
 {
        u64 addr = BLK_BOUNCE_HIGH;     /* dma64_addr_t */
 
-       if (on && drive->media == ide_disk) {
-               if (!PCI_DMA_BUS_IS_PHYS)
-                       addr = BLK_BOUNCE_ANY;
-               else if (HWIF(drive)->pci_dev)
+       if (!PCI_DMA_BUS_IS_PHYS) {
+               addr = BLK_BOUNCE_ANY;
+       } else if (on && drive->media == ide_disk) {
+               if (HWIF(drive)->pci_dev)
                        addr = HWIF(drive)->pci_dev->dma_mask;
        }
 
@@ -486,7 +485,7 @@ static u8 ide_dump_ata_status(ide_drive_t *drive, const char *msg, u8 stat)
        unsigned long flags;
        u8 err = 0;
 
-       local_irq_set(flags);
+       local_irq_save(flags);
        printk("%s: %s: status=0x%02x { ", drive->name, msg, stat);
        if (stat & BUSY_STAT)
                printk("Busy ");
@@ -568,7 +567,7 @@ static u8 ide_dump_atapi_status(ide_drive_t *drive, const char *msg, u8 stat)
 
        status.all = stat;
        error.all = 0;
-       local_irq_set(flags);
+       local_irq_save(flags);
        printk("%s: %s: status=0x%02x { ", drive->name, msg, stat);
        if (status.b.bsy)
                printk("Busy ");