diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2015-04-29 11:18:46 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2015-05-06 23:03:23 -0400 |
commit | ac01ce1410fc2c7b5f3af5e9c972e6a412eee54f (patch) | |
tree | 9e18395d231d04ca7e8832f87874be1aed9e8f00 /kernel | |
parent | 5ebe6afaf0057ac3eaeb98defd5456894b446d22 (diff) |
tracing: Make ftrace_print_array_seq compute buf_len
The only caller to this function (__print_array) was getting it wrong by
passing the array length instead of buffer length. As the element size
was already being passed for other reasons it seems reasonable to push
the calculation of buffer length into the function.
Link: http://lkml.kernel.org/r/1430320727-14582-1-git-send-email-alex.bennee@linaro.org
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/trace_output.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index 692bf7184c8c..25a086bcb700 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c | |||
@@ -178,12 +178,13 @@ ftrace_print_hex_seq(struct trace_seq *p, const unsigned char *buf, int buf_len) | |||
178 | EXPORT_SYMBOL(ftrace_print_hex_seq); | 178 | EXPORT_SYMBOL(ftrace_print_hex_seq); |
179 | 179 | ||
180 | const char * | 180 | const char * |
181 | ftrace_print_array_seq(struct trace_seq *p, const void *buf, int buf_len, | 181 | ftrace_print_array_seq(struct trace_seq *p, const void *buf, int count, |
182 | size_t el_size) | 182 | size_t el_size) |
183 | { | 183 | { |
184 | const char *ret = trace_seq_buffer_ptr(p); | 184 | const char *ret = trace_seq_buffer_ptr(p); |
185 | const char *prefix = ""; | 185 | const char *prefix = ""; |
186 | void *ptr = (void *)buf; | 186 | void *ptr = (void *)buf; |
187 | size_t buf_len = count * el_size; | ||
187 | 188 | ||
188 | trace_seq_putc(p, '{'); | 189 | trace_seq_putc(p, '{'); |
189 | 190 | ||