diff options
author | Shan Wei <davidshan@tencent.com> | 2012-11-13 01:53:04 (GMT) |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2013-01-21 18:22:30 (GMT) |
commit | d8a0349c0cea477322c66ea9362f10c62fad5f62 (patch) | |
tree | ca9bd84c3629bc166f407c34055eb809e416d430 /kernel/trace/blktrace.c | |
parent | 771e03842a9e98a1c2013ca1ed8bb2793488f3e5 (diff) | |
download | linux-fsl-qoriq-d8a0349c0cea477322c66ea9362f10c62fad5f62.tar.xz |
tracing: Use this_cpu_ptr per-cpu helper
typeof(&buffer) is a pointer to array of 1024 char, or char (*)[1024].
But, typeof(&buffer[0]) is a pointer to char which match the return type of get_trace_buf().
As well-known, the value of &buffer is equal to &buffer[0].
so return this_cpu_ptr(&percpu_buffer->buffer[0]) can avoid type cast.
Link: http://lkml.kernel.org/r/50A1A800.3020102@gmail.com
Reviewed-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Shan Wei <davidshan@tencent.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/blktrace.c')
-rw-r--r-- | kernel/trace/blktrace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index c0bd030..71259e2 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -147,7 +147,7 @@ void __trace_note_message(struct blk_trace *bt, const char *fmt, ...) return; local_irq_save(flags); - buf = per_cpu_ptr(bt->msg_data, smp_processor_id()); + buf = this_cpu_ptr(bt->msg_data); va_start(args, fmt); n = vscnprintf(buf, BLK_TN_MAX_MSG, fmt, args); va_end(args); |