mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
tracing: Have seq_buf use full buffer
Currently seq_buf is full when all but one byte of the buffer is filled. Change it so that the seq_buf is full when all of the buffer is filled. Some of the functions would fill the buffer completely and report everything was fine. This was inconsistent with the max of size - 1. Changing this to be max of size makes all functions consistent. Link: http://lkml.kernel.org/r/20141104160222.502133196@goodmis.org Link: http://lkml.kernel.org/r/20141114011412.811957882@goodmis.org Tested-by: Jiri Kosina <jkosina@suse.cz> Acked-by: Jiri Kosina <jkosina@suse.cz> Reviewed-by: Petr Mladek <pmladek@suse.cz> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This commit is contained in:
parent
9b77215382
commit
8cd709ae76
2 changed files with 9 additions and 6 deletions
|
@ -43,13 +43,13 @@ seq_buf_init(struct seq_buf *s, unsigned char *buf, unsigned int size)
|
|||
static inline bool
|
||||
seq_buf_has_overflowed(struct seq_buf *s)
|
||||
{
|
||||
return s->len == s->size;
|
||||
return s->len > s->size;
|
||||
}
|
||||
|
||||
static inline void
|
||||
seq_buf_set_overflow(struct seq_buf *s)
|
||||
{
|
||||
s->len = s->size;
|
||||
s->len = s->size + 1;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -61,7 +61,7 @@ seq_buf_buffer_left(struct seq_buf *s)
|
|||
if (seq_buf_has_overflowed(s))
|
||||
return 0;
|
||||
|
||||
return (s->size - 1) - s->len;
|
||||
return s->size - s->len;
|
||||
}
|
||||
|
||||
/* How much buffer was written? */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue