summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-04-19 07:00:42 +0900
committerTejun Heo <tj@kernel.org>2009-04-19 07:00:42 +0900
commit7f006dc24fae158131116c9472874f12e16cf040 (patch)
tree3b9999555f68297bef45deda4df902431d763a44
parent1873b90cdea038715ec7140fccc2116fb930ffb5 (diff)
downloadop-kernel-dev-7f006dc24fae158131116c9472874f12e16cf040.zip
op-kernel-dev-7f006dc24fae158131116c9472874f12e16cf040.tar.gz
ide-floppy: block pc always uses bio
Impact: remove unnecessary code path Block pc requests always use bio and rq->data is always NULL. No need to worry about !rq->bio cases in idefloppy_block_pc_cmd(). Note that ide-atapi uses ide_pio_bytes() for bio PIO transfer which handle sg fine. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Jens Axboe <axboe@kernel.dk>
-rw-r--r--drivers/ide/ide-floppy.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 2b4868d..3b22e06 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -216,15 +216,13 @@ static void idefloppy_blockpc_cmd(struct ide_disk_obj *floppy,
ide_init_pc(pc);
memcpy(pc->c, rq->cmd, sizeof(pc->c));
pc->rq = rq;
- if (rq->data_len && rq_data_dir(rq) == WRITE)
- pc->flags |= PC_FLAG_WRITING;
- pc->buf = rq->data;
- if (rq->bio)
+ if (rq->data_len) {
pc->flags |= PC_FLAG_DMA_OK;
- /*
- * possibly problematic, doesn't look like ide-floppy correctly
- * handled scattered requests if dma fails...
- */
+ if (rq_data_dir(rq) == WRITE)
+ pc->flags |= PC_FLAG_WRITING;
+ }
+ /* pio will be performed by ide_pio_bytes() which handles sg fine */
+ pc->buf = NULL;
pc->req_xfer = pc->buf_size = rq->data_len;
}
OpenPOWER on IntegriCloud