diff options
| author | Kees Cook <kees@kernel.org> | 2026-10-05 08:57:02 -0700 |
|---|---|---|
| committer | Kees Cook <kees@kernel.org> | 2026-10-11 21:57:30 -0700 |
| commit | e3f8dfafd7d6ef905afd6603b0b57984abd0677b (patch) | |
| tree | 5ee7e36d79f38af9c90caaae64a0a895eba3c747 /include/linux | |
| parent | 9ac219976ecfd0ad9c54050ed14f1da5d197cb69 (diff) | |
| download | linux-e3f8dfafd7d6ef905afd6603b0b57984abd0677b.tar.gz linux-e3f8dfafd7d6ef905afd6603b0b57984abd0677b.zip | |
docs: core-api: Document the seq_buf API
The kernel-doc in include/linux/seq_buf.h and lib/seq_buf.c documents
the seq_buf interface, but no .rst file pulls either of them in, so none
of it reaches the generated documentation.
Add the missing kernel-doc for seq_buf_clear() and seq_buf_init(), and a
Sequence Buffers section to the kernel API documentation. The static
internal helper seq_buf_can_fit() is left out. Additionally fix
seq_buf_hex_dump() indentation to avoid the reported Sphinx error:
ERROR: Unexpected indentation.
WARNING: Block quote ends without a blank line; unexpected unindent.
Verified with "make SPHINXDIRS=core-api htmldocs", which rendered
happily into core-api/kernel-api.html.
Assisted-by: LLM
Co-developed-by: Bill Wendling <morbo@google.com>
Signed-off-by: Bill Wendling <morbo@google.com>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://patch.msgid.link/20261005155708.1471260-12-kees@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/seq_buf.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/seq_buf.h b/include/linux/seq_buf.h index be979089228f..f006f2654e4c 100644 --- a/include/linux/seq_buf.h +++ b/include/linux/seq_buf.h @@ -31,6 +31,10 @@ struct seq_buf { .size = SIZE, \ } +/** + * seq_buf_clear - reset the seq_buf to be read / appended from the beginning + * @s: the seq_buf handle + */ static inline void seq_buf_clear(struct seq_buf *s) { s->len = 0; @@ -38,6 +42,14 @@ static inline void seq_buf_clear(struct seq_buf *s) s->buffer[0] = '\0'; } +/** + * seq_buf_init - initialize a seq_buf + * @s: the seq_buf handle + * @buf: pointer to the buffer + * @size: total size of @buf + * + * The contents of the buffer are ignored. + */ static inline void seq_buf_init(struct seq_buf *s, char *buf, unsigned int size) { |
