From 7e9799745cf254d30b34a81af427a70f0d56134d Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Tue, 15 Jul 2008 21:22:01 +0200 Subject: [PATCH] --- yaml --- r: 101260 b: refs/heads/master c: 08424ac24a35b505463919a897b097f27e4dca96 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/ide/ide-tape.c | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 0515317f486f..43fd8a4dfb4d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 74e63e74ea57e06839aa5fcf016eace35da26050 +refs/heads/master: 08424ac24a35b505463919a897b097f27e4dca96 diff --git a/trunk/drivers/ide/ide-tape.c b/trunk/drivers/ide/ide-tape.c index b224823a8ae7..6801c68ee7da 100644 --- a/trunk/drivers/ide/ide-tape.c +++ b/trunk/drivers/ide/ide-tape.c @@ -780,7 +780,14 @@ static void ide_tape_handle_dsc(ide_drive_t *drive) idetape_postpone_request(drive); } -typedef void idetape_io_buf(ide_drive_t *, struct ide_atapi_pc *, unsigned int); +static void ide_tape_io_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, + unsigned int bcount, int write) +{ + if (write) + idetape_output_buffers(drive, pc, bcount); + else + idetape_input_buffers(drive, pc, bcount); +} /* * This is the usual interrupt handler which will be called during a packet @@ -795,7 +802,6 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive) idetape_tape_t *tape = drive->driver_data; struct ide_atapi_pc *pc = tape->pc; xfer_func_t *xferfunc; - idetape_io_buf *iobuf; unsigned int temp; u16 bcount; u8 stat, ireason; @@ -895,15 +901,14 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive) debug_log(DBG_SENSE, "The device wants to send us more " "data than expected - allowing transfer\n"); } - iobuf = &idetape_input_buffers; xferfunc = hwif->input_data; } else { - iobuf = &idetape_output_buffers; xferfunc = hwif->output_data; } if (pc->bh) - iobuf(drive, pc, bcount); + ide_tape_io_buffers(drive, pc, bcount, + !!(pc->flags & PC_FLAG_WRITING)); else xferfunc(drive, NULL, pc->cur_pos, bcount);