diff mbox series

[v2,3/3] tracing: convert __trace_seq_init to use WARN_ON_ONCE

Message ID 20240125201621.143968-5-ricardo@marliere.net (mailing list archive)
State Superseded
Headers show
Series add trace_seq_reset function | expand

Commit Message

Ricardo B. Marliere Jan. 25, 2024, 8:16 p.m. UTC
The initialization of trace_seq buffers are done elsewhere and therefore
__trace_seq_init should yield a warning if it has to actually initialize
the buffer.

Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
---
 kernel/trace/trace_seq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/kernel/trace/trace_seq.c b/kernel/trace/trace_seq.c
index 741b2f3d76c0..3c7a7d903b54 100644
--- a/kernel/trace/trace_seq.c
+++ b/kernel/trace/trace_seq.c
@@ -32,7 +32,7 @@ 
  */
 static inline void __trace_seq_init(struct trace_seq *s)
 {
-	if (unlikely(!s->seq.size))
+	if (WARN_ON_ONCE(!s->seq.size))
 		trace_seq_init(s);
 }