projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
67c0716
)
floppy: cleanups: use memset() to zero reply_buffer
author
Denis Efremov
<efremov@linux.com>
Fri, 16 Apr 2021 08:34:47 +0000
(11:34 +0300)
committer
Jens Axboe
<axboe@kernel.dk>
Tue, 20 Apr 2021 14:59:03 +0000
(08:59 -0600)
Use memset() to zero reply buffer in raw_cmd_copyin() instead
of a for loop.
Signed-off-by: Denis Efremov <efremov@linux.com>
Link:
https://lore.kernel.org/r/20210416083449.72700-4-efremov@linux.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/floppy.c
patch
|
blob
|
history
diff --git
a/drivers/block/floppy.c
b/drivers/block/floppy.c
index
df5c329
..
c58b0b0
100644
(file)
--- a/
drivers/block/floppy.c
+++ b/
drivers/block/floppy.c
@@
-3090,7
+3090,6
@@
static int raw_cmd_copyin(int cmd, void __user *param,
{
struct floppy_raw_cmd *ptr;
int ret;
- int i;
*rcmd = NULL;
@@
-3109,8
+3108,7
@@
loop:
if (ptr->cmd_count > FD_RAW_CMD_FULLSIZE)
return -EINVAL;
- for (i = 0; i < FD_RAW_REPLY_SIZE; i++)
- ptr->reply[i] = 0;
+ memset(ptr->reply, 0, FD_RAW_REPLY_SIZE);
ptr->resultcode = 0;
if (ptr->flags & (FD_RAW_READ | FD_RAW_WRITE)) {