Bartlomiej Zolnierkiewicz wrote:
[PATCH] ide: remove atapi_ireason_t (take 2)
Remove atapi_ireason_t.
While at it:
* replace 'HWIF(drive)' by 'drive->hwif' (or just 'hwif' where possible)
v2:
* v1 had CD and IO bits reversed in many places.
* Use CD and IO defines from <linux/hdreg.h>.
You're reading my mind. :-)
Cc: Sergei Shtylyov <sshtylyov@xxxxxxxxxxxxx>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@xxxxxxxxx>
Index: b/drivers/ide/ide-floppy.c
===================================================================
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -788,12 +788,11 @@ static ide_startstop_t idefloppy_pc_intr
{
idefloppy_floppy_t *floppy = drive->driver_data;
ide_hwif_t *hwif = drive->hwif;
- atapi_ireason_t ireason;
idefloppy_pc_t *pc = floppy->pc;
struct request *rq = pc->rq;
unsigned int temp;
u16 bcount;
- u8 stat;
+ u8 stat, ireason;
debug_log(KERN_INFO "ide-floppy: Reached %s interrupt handler\n",
__FUNCTION__);
@@ -852,18 +851,18 @@ static ide_startstop_t idefloppy_pc_intr
bcount = (hwif->INB(IDE_BCOUNTH_REG) << 8) |
hwif->INB(IDE_BCOUNTL_REG);
/* on this interrupt */
- ireason.all = HWIF(drive)->INB(IDE_IREASON_REG);
+ ireason = hwif->INB(IDE_IREASON_REG);
- if (ireason.b.cod) {
+ if (ireason & CD) {
printk(KERN_ERR "ide-floppy: CoD != 0 in idefloppy_pc_intr\n");
return ide_do_reset(drive);
}
- if (ireason.b.io == test_bit(PC_WRITING, &pc->flags)) {
+ if ((ireason & IO) == test_bit(PC_WRITING, &pc->flags)) {
This won't work as IO is 0x02 and test_bit() returns 0 or 1.
[...]
Index: b/drivers/ide/ide-tape.c
===================================================================
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
[...]
@@ -1965,18 +1964,18 @@ static ide_startstop_t idetape_pc_intr (
bcount = (hwif->INB(IDE_BCOUNTH_REG) << 8) |
hwif->INB(IDE_BCOUNTL_REG);
- ireason.all = hwif->INB(IDE_IREASON_REG);
+ ireason = hwif->INB(IDE_IREASON_REG);
- if (ireason.b.cod) {
+ if (ireason & CD) {
printk(KERN_ERR "ide-tape: CoD != 0 in idetape_pc_intr\n");
return ide_do_reset(drive);
}
- if (ireason.b.io == test_bit(PC_WRITING, &pc->flags)) {
+ if ((ireason & IO) == test_bit(PC_WRITING, &pc->flags)) {
This won't work either...
[...]
MBR, Sergei
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html