diff options
author | Denis Efremov <efremov@linux.com> | 2021-04-16 11:34:48 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-04-20 08:59:03 -0600 |
commit | fa6b885e876ed4d29d1513fcf2d8bdc5c4b3b527 (patch) | |
tree | a52d667b2c4a7cb29af2e2724f0116ff3575838c | |
parent | f6df18f20d5bd496c4c2cb7564853cb60543332a (diff) |
floppy: cleanups: use memcpy() to copy reply_buffer
Use memcpy() in raw_cmd_done() to copy reply_buffer instead
of a for loop.
Signed-off-by: Denis Efremov <efremov@linux.com>
Link: https://lore.kernel.org/r/20210416083449.72700-5-efremov@linux.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | drivers/block/floppy.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index c58b0b079afc..c584657bacab 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -2988,8 +2988,6 @@ static const char *drive_name(int type, int drive) /* raw commands */ static void raw_cmd_done(int flag) { - int i; - if (!flag) { raw_cmd->flags |= FD_RAW_FAILURE; raw_cmd->flags |= FD_RAW_HARDFAILURE; @@ -2997,8 +2995,7 @@ static void raw_cmd_done(int flag) raw_cmd->reply_count = inr; if (raw_cmd->reply_count > FD_RAW_REPLY_SIZE) raw_cmd->reply_count = 0; - for (i = 0; i < raw_cmd->reply_count; i++) - raw_cmd->reply[i] = reply_buffer[i]; + memcpy(raw_cmd->reply, reply_buffer, raw_cmd->reply_count); if (raw_cmd->flags & (FD_RAW_READ | FD_RAW_WRITE)) { unsigned long flags; |