diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2014-11-06 16:38:28 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2014-11-19 22:01:13 -0500 |
commit | eeab98154dc0b49afd398afdd71c464a8af5911f (patch) | |
tree | d460d6f09a6a8160113d81efb6a4abe080c109c3 /kernel/trace | |
parent | 0736c033a81547b1cdc5120fc8dd60e26a00fd28 (diff) |
seq_buf: Create seq_buf_used() to find out how much was written
Add a helper function seq_buf_used() that replaces the SEQ_BUF_USED()
private macro to let callers have a method to know how much of the
seq_buf was written to.
Link: http://lkml.kernel.org/r/20141114011412.170377300@goodmis.org
Link: http://lkml.kernel.org/r/20141114011413.321654244@goodmis.org
Reviewed-by: Petr Mladek <pmladek@suse.cz>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/seq_buf.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/kernel/trace/seq_buf.c b/kernel/trace/seq_buf.c index 7dac34d1235b..9ec5305d9da7 100644 --- a/kernel/trace/seq_buf.c +++ b/kernel/trace/seq_buf.c | |||
@@ -16,9 +16,6 @@ | |||
16 | #include <linux/seq_file.h> | 16 | #include <linux/seq_file.h> |
17 | #include <linux/seq_buf.h> | 17 | #include <linux/seq_buf.h> |
18 | 18 | ||
19 | /* How much buffer is written? */ | ||
20 | #define SEQ_BUF_USED(s) min((s)->len, (s)->size - 1) | ||
21 | |||
22 | /** | 19 | /** |
23 | * seq_buf_print_seq - move the contents of seq_buf into a seq_file | 20 | * seq_buf_print_seq - move the contents of seq_buf into a seq_file |
24 | * @m: the seq_file descriptor that is the destination | 21 | * @m: the seq_file descriptor that is the destination |
@@ -28,7 +25,7 @@ | |||
28 | */ | 25 | */ |
29 | int seq_buf_print_seq(struct seq_file *m, struct seq_buf *s) | 26 | int seq_buf_print_seq(struct seq_file *m, struct seq_buf *s) |
30 | { | 27 | { |
31 | unsigned int len = SEQ_BUF_USED(s); | 28 | unsigned int len = seq_buf_used(s); |
32 | 29 | ||
33 | return seq_write(m, s->buffer, len); | 30 | return seq_write(m, s->buffer, len); |
34 | } | 31 | } |