Lines Matching refs:s

26 static inline void seq_buf_clear(struct seq_buf *s)  in seq_buf_clear()  argument
28 s->len = 0; in seq_buf_clear()
29 s->readpos = 0; in seq_buf_clear()
33 seq_buf_init(struct seq_buf *s, char *buf, unsigned int size) in seq_buf_init() argument
35 s->buffer = buf; in seq_buf_init()
36 s->size = size; in seq_buf_init()
37 seq_buf_clear(s); in seq_buf_init()
45 seq_buf_has_overflowed(struct seq_buf *s) in seq_buf_has_overflowed() argument
47 return s->len > s->size; in seq_buf_has_overflowed()
51 seq_buf_set_overflow(struct seq_buf *s) in seq_buf_set_overflow() argument
53 s->len = s->size + 1; in seq_buf_set_overflow()
60 seq_buf_buffer_left(struct seq_buf *s) in seq_buf_buffer_left() argument
62 if (seq_buf_has_overflowed(s)) in seq_buf_buffer_left()
65 return s->size - s->len; in seq_buf_buffer_left()
69 static inline unsigned int seq_buf_used(struct seq_buf *s) in seq_buf_used() argument
71 return min(s->len, s->size); in seq_buf_used()
88 static inline void seq_buf_terminate(struct seq_buf *s) in seq_buf_terminate() argument
90 if (WARN_ON(s->size == 0)) in seq_buf_terminate()
93 if (seq_buf_buffer_left(s)) in seq_buf_terminate()
94 s->buffer[s->len] = 0; in seq_buf_terminate()
96 s->buffer[s->size - 1] = 0; in seq_buf_terminate()
107 static inline size_t seq_buf_get_buf(struct seq_buf *s, char **bufp) in seq_buf_get_buf() argument
109 WARN_ON(s->len > s->size + 1); in seq_buf_get_buf()
111 if (s->len < s->size) { in seq_buf_get_buf()
112 *bufp = s->buffer + s->len; in seq_buf_get_buf()
113 return s->size - s->len; in seq_buf_get_buf()
129 static inline void seq_buf_commit(struct seq_buf *s, int num) in seq_buf_commit() argument
132 seq_buf_set_overflow(s); in seq_buf_commit()
135 BUG_ON(s->len + num > s->size); in seq_buf_commit()
136 s->len += num; in seq_buf_commit()
141 int seq_buf_printf(struct seq_buf *s, const char *fmt, ...);
143 int seq_buf_vprintf(struct seq_buf *s, const char *fmt, va_list args);
144 extern int seq_buf_print_seq(struct seq_file *m, struct seq_buf *s);
145 extern int seq_buf_to_user(struct seq_buf *s, char __user *ubuf,
147 extern int seq_buf_puts(struct seq_buf *s, const char *str);
148 extern int seq_buf_putc(struct seq_buf *s, unsigned char c);
149 extern int seq_buf_putmem(struct seq_buf *s, const void *mem, unsigned int len);
150 extern int seq_buf_putmem_hex(struct seq_buf *s, const void *mem,
152 extern int seq_buf_path(struct seq_buf *s, const struct path *path, const char *esc);
153 extern int seq_buf_hex_dump(struct seq_buf *s, const char *prefix_str,
159 seq_buf_bprintf(struct seq_buf *s, const char *fmt, const u32 *binary);
162 void seq_buf_do_printk(struct seq_buf *s, const char *lvl);