Skip to content

Commit

Permalink
floppy: use memcpy_{to,from}_bvec
Browse files Browse the repository at this point in the history
Use the helpers instead of open coding them.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Link: https://lore.kernel.org/r/20220303111905.321089-11-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Mar 4, 2022
1 parent 3eddaa6 commit 13d4ef0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/block/floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -2485,11 +2485,9 @@ static void copy_buffer(int ssize, int max_sector, int max_sector_2)
}

if (CT(raw_cmd->cmd[COMMAND]) == FD_READ)
memcpy_to_page(bv.bv_page, bv.bv_offset, dma_buffer,
size);
memcpy_to_bvec(&bv, dma_buffer);
else
memcpy_from_page(dma_buffer, bv.bv_page, bv.bv_offset,
size);
memcpy_from_bvec(dma_buffer, &bv);

remaining -= size;
dma_buffer += size;
Expand Down

0 comments on commit 13d4ef0

Please sign in to comment.