<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/lib/seq_buf.c, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-02-15T17:17:28+00:00</updated>
<entry>
<title>seq_buf: Fix kernel documentation</title>
<updated>2024-02-15T17:17:28+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2024-02-15T15:25:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6efe4d18796934b8ada66c1c446510e7f2d9b972'/>
<id>urn:sha1:6efe4d18796934b8ada66c1c446510e7f2d9b972</id>
<content type='text'>
There are plenty of issues with the kernel documentation here:
  - misspelled word "sequence"
  - different style of returned value descriptions
  - missed Return sections
  - unaligned style of ASCII / NUL-terminated / etc
  - wrong function references

Fix all these.

Link: https://lkml.kernel.org/r/20240215152506.598340-1-andriy.shevchenko@linux.intel.com

Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Reviewed-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Signed-off-by: Steven Rostedt (Google) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>seq_buf: Don't use "proxy" headers</title>
<updated>2024-02-15T17:16:46+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2024-02-15T14:22:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8a566f94104df87a067458351675129bb4e1ece2'/>
<id>urn:sha1:8a566f94104df87a067458351675129bb4e1ece2</id>
<content type='text'>
Update header inclusions to follow IWYU (Include What You Use)
principle.

Link: https://lkml.kernel.org/r/20240215142255.400264-1-andriy.shevchenko@linux.intel.com

Cc: "Matthew Wilcox (Oracle)" &lt;willy@infradead.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Steven Rostedt (Google) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>seq_buf: Export seq_buf_puts()</title>
<updated>2023-11-02T04:19:44+00:00</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2023-11-01T17:59:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=70a9affa930c7aeba27893c7d402ef1294f43aa2'/>
<id>urn:sha1:70a9affa930c7aeba27893c7d402ef1294f43aa2</id>
<content type='text'>
Mark seq_buf_puts() which is part of the seq_buf API to be exported to
kernel loadable GPL modules.

Link: https://lkml.kernel.org/r/b9e3737f66ec2450221b492048ce0d9c65c84953.1698861216.git.christophe.jaillet@wanadoo.fr

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Signed-off-by: Steven Rostedt (Google) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>seq_buf: Export seq_buf_putc()</title>
<updated>2023-11-02T04:18:52+00:00</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2023-11-01T17:59:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=685b38c7650a0f461f56761cf61936b453d5bb24'/>
<id>urn:sha1:685b38c7650a0f461f56761cf61936b453d5bb24</id>
<content type='text'>
Mark seq_buf_putc() which is part of the seq_buf API to be exported to
kernel loadable GPL modules.

Link: https://lkml.kernel.org/r/5c9a5ed97ac37dbdcd9c1e7bcbdec9ac166e79be.1698861216.git.christophe.jaillet@wanadoo.fr

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Signed-off-by: Steven Rostedt (Google) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>seq_buf: Introduce DECLARE_SEQ_BUF and seq_buf_str()</title>
<updated>2023-10-28T20:52:43+00:00</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2023-10-27T15:56:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dcc4e5728eeaeda84878ca0018758cff1abfca21'/>
<id>urn:sha1:dcc4e5728eeaeda84878ca0018758cff1abfca21</id>
<content type='text'>
Solve two ergonomic issues with struct seq_buf;

1) Too much boilerplate is required to initialize:

	struct seq_buf s;
	char buf[32];

	seq_buf_init(s, buf, sizeof(buf));

Instead, we can build this directly on the stack. Provide
DECLARE_SEQ_BUF() macro to do this:

	DECLARE_SEQ_BUF(s, 32);

2) %NUL termination is fragile and requires 2 steps to get a valid
   C String (and is a layering violation exposing the "internals" of
   seq_buf):

	seq_buf_terminate(s);
	do_something(s-&gt;buffer);

Instead, we can just return s-&gt;buffer directly after terminating it in
the refactored seq_buf_terminate(), now known as seq_buf_str():

	do_something(seq_buf_str(s));

Link: https://lore.kernel.org/linux-trace-kernel/20231027155634.make.260-kees@kernel.org
Link: https://lore.kernel.org/linux-trace-kernel/20231026194033.it.702-kees@kernel.org/

Cc: Yosry Ahmed &lt;yosryahmed@google.com&gt;
Cc: "Matthew Wilcox (Oracle)" &lt;willy@infradead.org&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Justin Stitt &lt;justinstitt@google.com&gt;
Cc: Kent Overstreet &lt;kent.overstreet@linux.dev&gt;
Cc: Petr Mladek &lt;pmladek@suse.com&gt;
Cc: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Cc: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Cc: Sergey Senozhatsky &lt;senozhatsky@chromium.org&gt;
Cc: Masami Hiramatsu &lt;mhiramat@kernel.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Cc: Yun Zhou &lt;yun.zhou@windriver.com&gt;
Cc: Jacob Keller &lt;jacob.e.keller@intel.com&gt;
Cc: Zhen Lei &lt;thunder.leizhen@huawei.com&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Steven Rostedt (Google) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Move readpos from seq_buf to trace_seq</title>
<updated>2023-10-20T16:16:10+00:00</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2023-10-20T03:35:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d0ed46b60396cfa7e0056f55e1ce0b43c7db57b6'/>
<id>urn:sha1:d0ed46b60396cfa7e0056f55e1ce0b43c7db57b6</id>
<content type='text'>
To make seq_buf more lightweight as a string buf, move the readpos member
from seq_buf to its container, trace_seq.  That puts the responsibility
of maintaining the readpos entirely in the tracing code.  If some future
users want to package up the readpos with a seq_buf, we can define a
new struct then.

Link: https://lore.kernel.org/linux-trace-kernel/20231020033545.2587554-2-willy@infradead.org

Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Justin Stitt &lt;justinstitt@google.com&gt;
Cc: Kent Overstreet &lt;kent.overstreet@linux.dev&gt;
Cc: Petr Mladek &lt;pmladek@suse.com&gt;
Cc: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Cc: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Cc: Sergey Senozhatsky &lt;senozhatsky@chromium.org&gt;
Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Steven Rostedt (Google) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>seq_buf: Add seq_buf_do_printk() helper</title>
<updated>2023-04-26T01:03:14+00:00</updated>
<author>
<name>Sergey Senozhatsky</name>
<email>senozhatsky@chromium.org</email>
</author>
<published>2023-04-15T10:01:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=96928d9032a7c34f12a88df879665562bcebf59a'/>
<id>urn:sha1:96928d9032a7c34f12a88df879665562bcebf59a</id>
<content type='text'>
Sometimes we use seq_buf to format a string buffer, which
we then pass to printk(). However, in certain situations
the seq_buf string buffer can get too big, exceeding the
PRINTKRB_RECORD_MAX bytes limit, and causing printk() to
truncate the string.

Add a new seq_buf helper. This helper prints the seq_buf
string buffer line by line, using \n as a delimiter,
rather than passing the whole string buffer to printk()
at once.

Link: https://lkml.kernel.org/r/20230415100110.1419872-1-senozhatsky@chromium.org

Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Sergey Senozhatsky &lt;senozhatsky@chromium.org&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Tested-by: Yosry Ahmed &lt;yosryahmed@google.com&gt;
Signed-off-by: Steven Rostedt (Google) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>lib: fix spelling mistakes</title>
<updated>2021-07-08T18:48:20+00:00</updated>
<author>
<name>Zhen Lei</name>
<email>thunder.leizhen@huawei.com</email>
</author>
<published>2021-07-08T01:07:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9dbbc3b9d09d6deba9f3b9e1d5b355032ed46a75'/>
<id>urn:sha1:9dbbc3b9d09d6deba9f3b9e1d5b355032ed46a75</id>
<content type='text'>
Fix some spelling mistakes in comments:
permanentely ==&gt; permanently
wont ==&gt; won't
remaning ==&gt; remaining
succed ==&gt; succeed
shouldnt ==&gt; shouldn't
alpha-numeric ==&gt; alphanumeric
storeing ==&gt; storing
funtion ==&gt; function
documenation ==&gt; documentation
Determin ==&gt; Determine
intepreted ==&gt; interpreted
ammount ==&gt; amount
obious ==&gt; obvious
interupts ==&gt; interrupts
occured ==&gt; occurred
asssociated ==&gt; associated
taking into acount ==&gt; taking into account
squence ==&gt; sequence
stil ==&gt; still
contiguos ==&gt; contiguous
matchs ==&gt; matches

Link: https://lkml.kernel.org/r/20210607072555.12416-1-thunder.leizhen@huawei.com
Signed-off-by: Zhen Lei &lt;thunder.leizhen@huawei.com&gt;
Reviewed-by: Jacob Keller &lt;jacob.e.keller@intel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>seq_buf: Make trace_seq_putmem_hex() support data longer than 8</title>
<updated>2021-06-26T13:19:16+00:00</updated>
<author>
<name>Yun Zhou</name>
<email>yun.zhou@windriver.com</email>
</author>
<published>2021-06-26T03:21:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6a2cbc58d6c9d90cd74288cc497c2b45815bc064'/>
<id>urn:sha1:6a2cbc58d6c9d90cd74288cc497c2b45815bc064</id>
<content type='text'>
Since the raw memory 'data' does not go forward, it will dump repeated
data if the data length is more than 8. If we want to dump longer data
blocks, we need to repeatedly call macro SEQ_PUT_HEX_FIELD. I think it
is a bit redundant, and multiple function calls also affect the performance.

Link: https://lore.kernel.org/lkml/20210625122453.5e2fe304@oasis.local.home/
Link: https://lkml.kernel.org/r/20210626032156.47889-2-yun.zhou@windriver.com

Cc: stable@vger.kernel.org
Fixes: 6d2289f3faa7 ("tracing: Make trace_seq_putmem_hex() more robust")
Signed-off-by: Yun Zhou &lt;yun.zhou@windriver.com&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>seq_buf: Fix overflow in seq_buf_putmem_hex()</title>
<updated>2021-06-26T13:18:48+00:00</updated>
<author>
<name>Yun Zhou</name>
<email>yun.zhou@windriver.com</email>
</author>
<published>2021-06-26T03:21:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d3b16034a24a112bb83aeb669ac5b9b01f744bb7'/>
<id>urn:sha1:d3b16034a24a112bb83aeb669ac5b9b01f744bb7</id>
<content type='text'>
There's two variables being increased in that loop (i and j), and i
follows the raw data, and j follows what is being written into the buffer.
We should compare 'i' to MAX_MEMHEX_BYTES or compare 'j' to HEX_CHARS.
Otherwise, if 'j' goes bigger than HEX_CHARS, it will overflow the
destination buffer.

Link: https://lore.kernel.org/lkml/20210625122453.5e2fe304@oasis.local.home/
Link: https://lkml.kernel.org/r/20210626032156.47889-1-yun.zhou@windriver.com

Cc: stable@vger.kernel.org
Fixes: 5e3ca0ec76fce ("ftrace: introduce the "hex" output method")
Signed-off-by: Yun Zhou &lt;yun.zhou@windriver.com&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
</feed>
