* [PATCH] seq_buf: fix a misleading comment
@ 2023-10-20 20:38 Jonathan Corbet
2023-10-20 20:49 ` Steven Rostedt
0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Corbet @ 2023-10-20 20:38 UTC (permalink / raw)
To: Steven Rostedt (Google); +Cc: LKML
The comment for seq_buf_has_overflowed() says that an overflow condition is
marked by len == size, but that's not what the code is testing. Make the
comment match reality.
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
---
include/linux/seq_buf.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/seq_buf.h b/include/linux/seq_buf.h
index 515d7fcb9634..026302765494 100644
--- a/include/linux/seq_buf.h
+++ b/include/linux/seq_buf.h
@@ -39,7 +39,7 @@ seq_buf_init(struct seq_buf *s, char *buf, unsigned int size)
/*
* seq_buf have a buffer that might overflow. When this happens
- * the len and size are set to be equal.
+ * len is set to be greater than size.
*/
static inline bool
seq_buf_has_overflowed(struct seq_buf *s)
--
2.41.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] seq_buf: fix a misleading comment
2023-10-20 20:38 [PATCH] seq_buf: fix a misleading comment Jonathan Corbet
@ 2023-10-20 20:49 ` Steven Rostedt
0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2023-10-20 20:49 UTC (permalink / raw)
To: Jonathan Corbet; +Cc: LKML
On Fri, 20 Oct 2023 14:38:49 -0600
Jonathan Corbet <corbet@lwn.net> wrote:
> The comment for seq_buf_has_overflowed() says that an overflow condition is
> marked by len == size, but that's not what the code is testing. Make the
> comment match reality.
>
I guess we can add:
Fixes: 8cd709ae7658a ("tracing: Have seq_buf use full buffer")
Thanks!
-- Steve
> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
> ---
> include/linux/seq_buf.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/seq_buf.h b/include/linux/seq_buf.h
> index 515d7fcb9634..026302765494 100644
> --- a/include/linux/seq_buf.h
> +++ b/include/linux/seq_buf.h
> @@ -39,7 +39,7 @@ seq_buf_init(struct seq_buf *s, char *buf, unsigned int size)
>
> /*
> * seq_buf have a buffer that might overflow. When this happens
> - * the len and size are set to be equal.
> + * len is set to be greater than size.
> */
> static inline bool
> seq_buf_has_overflowed(struct seq_buf *s)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-10-20 20:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-20 20:38 [PATCH] seq_buf: fix a misleading comment Jonathan Corbet
2023-10-20 20:49 ` Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox