Commit f8c5e944 authored by Chen Gang's avatar Chen Gang Committed by Jens Axboe

kernel: trace: blktrace: remove redundent memcpy() in compat_blk_trace_setup()

do_blk_trace_setup() will fully initialize '', so can remove
the related memcpy(). And also use BLKTRACE_BDEV_SIZE and ARRAY_SIZE
instead of hard code number '32'.
Signed-off-by: default avatarChen Gang <>
Signed-off-by: default avatarJens Axboe <>
parent 6678d83f
......@@ -89,7 +89,7 @@ static inline int blk_trace_init_sysfs(struct device *dev)
struct compat_blk_user_trace_setup {
char name[32];
u16 act_mask;
u32 buf_size;
u32 buf_nr;
......@@ -579,13 +579,12 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
.end_lba = cbuts.end_lba,
.pid =,
memcpy(&, &, 32);
ret = do_blk_trace_setup(q, name, dev, bdev, &buts);
if (ret)
return ret;
if (copy_to_user(arg, &, 32)) {
if (copy_to_user(arg, &, ARRAY_SIZE( {
return -EFAULT;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment