From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Subject: [PATCH 4/15] ide: remove atapi_error_t
Date: Wed, 31 Oct 2007 00:25:55 +0100 [thread overview]
Message-ID: <200710310025.55983.bzolnier@gmail.com> (raw)
Remove atapi_error_t.
While at it:
* replace 'HWIF(drive)' by 'drive->hwif'
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-floppy.c | 3 +--
drivers/ide/ide-lib.c | 21 ++++++++++-----------
drivers/ide/ide-tape.c | 3 +--
include/linux/ide.h | 30 ------------------------------
4 files changed, 12 insertions(+), 45 deletions(-)
Index: b/drivers/ide/ide-floppy.c
===================================================================
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -772,9 +772,8 @@ static void idefloppy_retry_pc (ide_driv
{
idefloppy_pc_t *pc;
struct request *rq;
- atapi_error_t error;
- error.all = HWIF(drive)->INB(IDE_ERROR_REG);
+ (void)drive->hwif->INB(IDE_ERROR_REG);
pc = idefloppy_next_pc_storage(drive);
rq = idefloppy_next_rq_storage(drive);
idefloppy_create_request_sense_cmd(pc);
Index: b/drivers/ide/ide-lib.c
===================================================================
--- a/drivers/ide/ide-lib.c
+++ b/drivers/ide/ide-lib.c
@@ -558,9 +558,8 @@ static u8 ide_dump_ata_status(ide_drive_
static u8 ide_dump_atapi_status(ide_drive_t *drive, const char *msg, u8 stat)
{
unsigned long flags;
- atapi_error_t error;
+ u8 err = 0;
- error.all = 0;
local_irq_save(flags);
printk("%s: %s: status=0x%02x { ", drive->name, msg, stat);
if (stat & BUSY_STAT)
@@ -576,19 +575,19 @@ static u8 ide_dump_atapi_status(ide_driv
}
printk("}\n");
if ((stat & (BUSY_STAT|ERR_STAT)) == ERR_STAT) {
- error.all = HWIF(drive)->INB(IDE_ERROR_REG);
- printk("%s: %s: error=0x%02x { ", drive->name, msg, error.all);
- if (error.b.ili) printk("IllegalLengthIndication ");
- if (error.b.eom) printk("EndOfMedia ");
- if (error.b.abrt) printk("AbortedCommand ");
- if (error.b.mcr) printk("MediaChangeRequested ");
- if (error.b.sense_key) printk("LastFailedSense=0x%02x ",
- error.b.sense_key);
+ err = drive->hwif->INB(IDE_ERROR_REG);
+ printk("%s: %s: error=0x%02x { ", drive->name, msg, err);
+ if (err & MARK_ERR) printk("IllegalLengthIndication ");
+ if (err & TRK0_ERR) printk("EndOfMedia ");
+ if (err & ABRT_ERR) printk("AbortedCommand ");
+ if (err & MCR_ERR) printk("MediaChangeRequested ");
+ if (err & 0xf0) printk("LastFailedSense=0x%02x ",
+ (err & 0xf0) >> 4);
printk("}\n");
}
ide_dump_opcode(drive);
local_irq_restore(flags);
- return error.all;
+ return err;
}
/**
Index: b/drivers/ide/ide-tape.c
===================================================================
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -1808,9 +1808,8 @@ static ide_startstop_t idetape_retry_pc
idetape_tape_t *tape = drive->driver_data;
idetape_pc_t *pc;
struct request *rq;
- atapi_error_t error;
- error.all = HWIF(drive)->INB(IDE_ERROR_REG);
+ (void)drive->hwif->INB(IDE_ERROR_REG);
pc = idetape_next_pc_storage(drive);
rq = idetape_next_rq_storage(drive);
idetape_create_request_sense_cmd(pc);
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -417,36 +417,6 @@ typedef union {
} atapi_ireason_t;
/*
- * The ATAPI error register.
- *
- * ili : Illegal Length Indication
- * eom : End Of Media Detected
- * abrt : Aborted command - As defined by ATA
- * mcr : Media Change Requested - As defined by ATA
- * sense_key : Sense key of the last failed packet command
- */
-typedef union {
- unsigned all :8;
- struct {
-#if defined(__LITTLE_ENDIAN_BITFIELD)
- unsigned ili :1;
- unsigned eom :1;
- unsigned abrt :1;
- unsigned mcr :1;
- unsigned sense_key :4;
-#elif defined(__BIG_ENDIAN_BITFIELD)
- unsigned sense_key :4;
- unsigned mcr :1;
- unsigned abrt :1;
- unsigned eom :1;
- unsigned ili :1;
-#else
-#error "Please fix <asm/byteorder.h>"
-#endif
- } b;
-} atapi_error_t;
-
-/*
* Status returned from various ide_ functions
*/
typedef enum {
next reply other threads:[~2007-10-30 23:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-30 23:25 Bartlomiej Zolnierkiewicz [this message]
2007-11-01 18:47 ` [PATCH 4/15] ide: remove atapi_error_t Sergei Shtylyov
2007-11-02 20:04 ` Bartlomiej Zolnierkiewicz
2007-11-04 13:05 ` Sergei Shtylyov
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=200710310025.55983.bzolnier@gmail.com \
--to=bzolnier@gmail.com \
--cc=linux-ide@vger.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).