Skip to content

Commit 8968932

Browse files
htejunJens Axboe
authored andcommitted
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>
1 parent 59a4f6f commit 8968932

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

‎drivers/ide/ide-floppy.c‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -216,15 +216,13 @@ static void idefloppy_blockpc_cmd(struct ide_disk_obj *floppy,
216216
ide_init_pc(pc);
217217
memcpy(pc->c, rq->cmd, sizeof(pc->c));
218218
pc->rq = rq;
219-
if (rq->data_len && rq_data_dir(rq) == WRITE)
220-
pc->flags |= PC_FLAG_WRITING;
221-
pc->buf = rq->data;
222-
if (rq->bio)
219+
if (rq->data_len) {
223220
pc->flags |= PC_FLAG_DMA_OK;
224-
/*
225-
* possibly problematic, doesn't look like ide-floppy correctly
226-
* handled scattered requests if dma fails...
227-
*/
221+
if (rq_data_dir(rq) == WRITE)
222+
pc->flags |= PC_FLAG_WRITING;
223+
}
224+
/* pio will be performed by ide_pio_bytes() which handles sg fine */
225+
pc->buf = NULL;
228226
pc->req_xfer = pc->buf_size = rq->data_len;
229227
}
230228

0 commit comments

Comments
 (0)