diff options
author | Chen Gang <gang.chen@asianux.com> | 2013-11-03 14:23:39 (GMT) |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2013-11-08 16:04:30 (GMT) |
commit | f8c5e94486671ffcac696886c246baa6ba89b5cf (patch) | |
tree | 9a4cf461b240740a0670cc364aec7851b3907ae1 /kernel/trace | |
parent | 6678d83f18386eb103f8345024e52c5abe61725c (diff) | |
download | linux-fsl-qoriq-f8c5e94486671ffcac696886c246baa6ba89b5cf.tar.xz |
kernel: trace: blktrace: remove redundent memcpy() in compat_blk_trace_setup()
do_blk_trace_setup() will fully initialize 'buts.name', so can remove
the related memcpy(). And also use BLKTRACE_BDEV_SIZE and ARRAY_SIZE
instead of hard code number '32'.
Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/blktrace.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 7f727b3..f785aef 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -579,13 +579,12 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name, .end_lba = cbuts.end_lba, .pid = cbuts.pid, }; - memcpy(&buts.name, &cbuts.name, 32); ret = do_blk_trace_setup(q, name, dev, bdev, &buts); if (ret) return ret; - if (copy_to_user(arg, &buts.name, 32)) { + if (copy_to_user(arg, &buts.name, ARRAY_SIZE(buts.name))) { blk_trace_remove(q); return -EFAULT; } |