[PATCH v3 3/3] tracing: convert __trace_seq_init to use WARN_ON_ONCE
From: Ricardo B. Marliere
Date: Thu Jan 25 2024 - 17:29:09 EST
The initialization of trace_seq buffers is done elsewhere and therefore
__trace_seq_init should yield a warning if it has to actually initialize
the buffer.
Suggested-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
Signed-off-by: Ricardo B. Marliere <ricardo@xxxxxxxxxxxx>
---
kernel/trace/trace_seq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
}
--
2.43.0