mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
seq_file: Rename seq_overflow() to seq_has_overflowed() and make public
The return values of seq_printf/puts/putc are frequently misused. Start down a path to remove all the return value uses of these functions. Move the seq_overflow() to a global inlined function called seq_has_overflowed() that can be used by the users of seq_file() calls. Update the documentation to not show return types for seq_printf et al. Add a description of seq_has_overflowed(). Link: http://lkml.kernel.org/p/848ac7e3d1c31cddf638a8526fa3c59fa6fdeb8a.1412031505.git.joe@perches.com Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Joe Perches <joe@perches.com> [ Reworked the original patch from Joe ] Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This commit is contained in:
committed by
Steven Rostedt
parent
f114040e3e
commit
1f33c41c03
@@ -42,6 +42,21 @@ struct seq_operations {
|
||||
|
||||
#define SEQ_SKIP 1
|
||||
|
||||
/**
|
||||
* seq_has_overflowed - check if the buffer has overflowed
|
||||
* @m: the seq_file handle
|
||||
*
|
||||
* seq_files have a buffer which may overflow. When this happens a larger
|
||||
* buffer is reallocated and all the data will be printed again.
|
||||
* The overflow state is true when m->count == m->size.
|
||||
*
|
||||
* Returns true if the buffer received more than it can hold.
|
||||
*/
|
||||
static inline bool seq_has_overflowed(struct seq_file *m)
|
||||
{
|
||||
return m->count == m->size;
|
||||
}
|
||||
|
||||
/**
|
||||
* seq_get_buf - get buffer to write arbitrary data to
|
||||
* @m: the seq_file handle
|
||||
|
Reference in New Issue
Block a user