From: Hannes Reinecke <hare@suse.de>
To: Tejun Heo <tj@kernel.org>
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
Hannes Reinecke <hare@suse.de>
Subject: [PATCH 5/9] libata: use status bit definitions in ata_dump_status()
Date: Fri, 27 Mar 2015 16:46:34 +0100 [thread overview]
Message-ID: <1427471198-62676-6-git-send-email-hare@suse.de> (raw)
In-Reply-To: <1427471198-62676-1-git-send-email-hare@suse.de>
Use the bit definitions for better readability.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/ata/libata-scsi.c | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 1f1cb69..f065cb1 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -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");
}
}
--
1.8.5.2
next prev parent reply other threads:[~2015-03-27 15:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-27 15:46 [PATCH 0/9] libata sense code update Hannes Reinecke
2015-03-27 15:46 ` [PATCH 1/9] libata: use READ_LOG_DMA_EXT Hannes Reinecke
2015-03-27 15:46 ` [PATCH 2/9] libata: whitespace cleanup in ata_get_cmd_descript() Hannes Reinecke
2015-03-27 15:46 ` [PATCH 3/9] libata: whitespace fixes in ata_to_sense_error() Hannes Reinecke
2015-03-27 15:46 ` [PATCH 4/9] ide,ata: Rename ATA_IDX to ATA_SENSE Hannes Reinecke
2015-03-31 17:07 ` David Miller
2015-03-27 15:46 ` Hannes Reinecke [this message]
2015-03-27 15:46 ` [PATCH 6/9] libata: Implement NCQ autosense Hannes Reinecke
2015-03-27 15:46 ` [PATCH 7/9] libata: Implement support for sense data reporting Hannes Reinecke
2015-03-27 15:46 ` [PATCH 8/9] libata-eh: Set 'information' field for autosense Hannes Reinecke
2015-03-27 15:46 ` [PATCH 9/9] libata: Add tracepoints Hannes Reinecke
2015-03-27 16:01 ` [PATCH 0/9] libata sense code update Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1427471198-62676-6-git-send-email-hare@suse.de \
--to=hare@suse.de \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).