libata: use status bit definitions in ata_dump_status()
authorHannes Reinecke <hare@suse.de>
Fri, 27 Mar 2015 15:46:34 +0000 (16:46 +0100)
committerTejun Heo <tj@kernel.org>
Fri, 27 Mar 2015 15:59:22 +0000 (11:59 -0400)
Use the bit definitions for better readability.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Tejun Heo <tj@kernel.org>
drivers/ata/libata-scsi.c

index b96e3b7..bb57d81 100644 (file)
@@ -799,26 +799,27 @@ static void ata_dump_status(unsigned id, struct ata_taskfile *tf)
        if (stat & ATA_BUSY) {
                printk("Busy }\n");     /* Data is not valid in this case */
        } else {
-               if (stat & 0x40)        printk("DriveReady ");
-               if (stat & 0x20)        printk("DeviceFault ");
-               if (stat & 0x10)        printk("SeekComplete ");
-               if (stat & 0x08)        printk("DataRequest ");
-               if (stat & 0x04)        printk("CorrectedError ");
-               if (stat & 0x02)        printk("Sense ");
-               if (stat & 0x01)        printk("Error ");
+               if (stat & ATA_DRDY)    printk("DriveReady ");
+               if (stat & ATA_DF)      printk("DeviceFault ");
+               if (stat & ATA_DSC)     printk("SeekComplete ");
+               if (stat & ATA_DRQ)     printk("DataRequest ");
+               if (stat & ATA_CORR)    printk("CorrectedError ");
+               if (stat & ATA_SENSE)   printk("Sense ");
+               if (stat & ATA_ERR)     printk("Error ");
                printk("}\n");
 
                if (err) {
                        printk(KERN_WARNING "ata%u: error=0x%02x { ", id, err);
-                       if (err & 0x04)         printk("DriveStatusError ");
-                       if (err & 0x80) {
-                               if (err & 0x04) printk("BadCRC ");
+                       if (err & ATA_ABORTED)  printk("DriveStatusError ");
+                       if (err & ATA_ICRC) {
+                               if (err & ATA_ABORTED)
+                                               printk("BadCRC ");
                                else            printk("Sector ");
                        }
-                       if (err & 0x40)         printk("UncorrectableError ");
-                       if (err & 0x10)         printk("SectorIdNotFound ");
-                       if (err & 0x02)         printk("TrackZeroNotFound ");
-                       if (err & 0x01)         printk("AddrMarkNotFound ");
+                       if (err & ATA_UNC)      printk("UncorrectableError ");
+                       if (err & ATA_IDNF)     printk("SectorIdNotFound ");
+                       if (err & ATA_TRK0NF)   printk("TrackZeroNotFound ");
+                       if (err & ATA_AMNF)     printk("AddrMarkNotFound ");
                        printk("}\n");
                }
        }