[for-next][PATCH] ring-buffer: Remove stale comment from ring_buffer_size()

From: Steven Rostedt
Date: Wed Jan 10 2024 - 11:06:27 EST



Found this sitting it patchwork and never pulled it in.

git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
trace/for-next

Head SHA1: 25742aeb135c4a44e92fb347e037adaa145b9484


Steven Rostedt (Google) (1):
ring-buffer: Remove stale comment from ring_buffer_size()

----
kernel/trace/ring_buffer.c | 6 ------
1 file changed, 6 deletions(-)
---------------------------
commit 25742aeb135c4a44e92fb347e037adaa145b9484
Author: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
Date: Wed Dec 20 08:10:28 2023 -0500

ring-buffer: Remove stale comment from ring_buffer_size()

It's been 11 years since the ring_buffer_size() function was updated to
use the nr_pages from the buffer->buffers[cpu] structure instead of using
the buffer->nr_pages that no longer exists.

The comment in the code is more of what a change log should have and is
pretty much useless for development. It's saying how things worked back in
2012 that bares no purpose on today's code. Remove it.

Link: https://lore.kernel.org/linux-trace-kernel/84d3b41a72bd43dbb9d44921ef535c92@xxxxxxxxxxxxxxxx/
Link: https://lore.kernel.org/linux-trace-kernel/20231220081028.7cd7e8e2@xxxxxxxxxxxxxxxxxx

Cc: Mark Rutland <mark.rutland@xxxxxxx>
Cc: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>
Reported-by: David Laight <David.Laight@xxxxxxxxxx>
Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
Acked-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>

diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 173d2595ce2d..7887d61d5b56 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -5122,12 +5122,6 @@ EXPORT_SYMBOL_GPL(ring_buffer_iter_advance);
*/
unsigned long ring_buffer_size(struct trace_buffer *buffer, int cpu)
{
- /*
- * Earlier, this method returned
- * buffer->subbuf_size * buffer->nr_pages
- * Since the nr_pages field is now removed, we have converted this to
- * return the per cpu buffer value.
- */
if (!cpumask_test_cpu(cpu, buffer->cpumask))
return 0;