Re: [PATCH] seq_file: Fix seq_putc() to be consistent with seq_puts()
From: Steven Rostedt <rostedt@goodmis.org>
Date: 2014-09-29 16:09:44
On Mon, 29 Sep 2014 16:47:12 +0100 Al Viro [off-list ref] wrote:
What we need is a helper along the lines of seq_already_overflown() that could be used by the few places that really want that hint. As in if (seq_already_overflown(m)) return 0; // we'll be called again with bigger buffer anyway
We already have that, it's called seq_overflow(), but it's a static function in seq_file.c. We can easily move that to seq_file.h. If you want to rename it to seq_already_overflown() that would be fine.
And let's make seq_printf and friends return void. Any breakage we miss on grep will be caught by compiler. Enough is enough.
I'm good with this. Note, I'm trying to make a seq_buf.c file that consolidates the code in trace_seq.c and seq_file.c. This will extend slightly the use cases of the seq_buf functions, but I think all the seq_*() functions from seq_file.c can be turned into functions that return void. I'm thinking of making m->count > m->size be what returns overflow as true, as m->count == m->size can have all the data, that is, nothing lost. I'll start writing up some patches. -- Steve