Skip to contentSkip to conversation

ring-buffer: Remove stale comment from ring_buffer_size()

PATCH In review Steven Rostedt 2 participants 2 messages Dec 20, 2023

Subsystems (2)
lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

PATCH 1/1 ring-buffer: Remove stale comment from ring_buffer_size()

From: "Steven Rostedt (Google)" <[email protected]>

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.

---
 kernel/trace/ring_buffer.c | 6 ------
 1 file changed, 6 deletions(-)
kernel/trace/ring_buffer.c +0 -6
index 173d2595ce2d..7887d61d5b56 100644
@@ -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;
 
Signature · 1 line
2.42.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · On Wed, 20 Dec 2023 08:10:28 -0500 Steven Rostedt <[email protected]> wrote:

From: "Steven Rostedt (Google)" <[email protected]>

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.

Quoted 6 lines

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.

Looks good to me.

Thanks,

Quoted 26 lines
---
 kernel/trace/ring_buffer.c | 6 ------
 1 file changed, 6 deletions(-)
kernel/trace/ring_buffer.c +0 -6
index 173d2595ce2d..7887d61d5b56 100644
@@ -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;
 
Signature · 1 line
2.42.0
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>