2022-10-09 02:19:25

by Jiapeng Chong

[permalink] [raw]
Subject: [PATCH v2] ring-buffer: Fix kernel-doc

kernel/trace/ring_buffer.c:895: warning: expecting prototype for ring_buffer_nr_pages_dirty(). Prototype was for ring_buffer_nr_dirty_pages() instead.
kernel/trace/ring_buffer.c:5313: warning: expecting prototype for ring_buffer_reset_cpu(). Prototype was for ring_buffer_reset_online_cpus() instead.
kernel/trace/ring_buffer.c:5382: warning: expecting prototype for rind_buffer_empty(). Prototype was for ring_buffer_empty() instead.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2340
Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Jiapeng Chong <[email protected]>
---
Changes in v2:
-Get rid of the parenthesis.

kernel/trace/ring_buffer.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index c3f354cfc5ba..199759c73519 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -885,7 +885,7 @@ size_t ring_buffer_nr_pages(struct trace_buffer *buffer, int cpu)
}

/**
- * ring_buffer_nr_pages_dirty - get the number of used pages in the ring buffer
+ * ring_buffer_nr_dirty_pages - get the number of used pages in the ring buffer
* @buffer: The ring_buffer to get the number of pages from
* @cpu: The cpu of the ring_buffer to get the number of pages from
*
@@ -5305,7 +5305,7 @@ void ring_buffer_reset_cpu(struct trace_buffer *buffer, int cpu)
EXPORT_SYMBOL_GPL(ring_buffer_reset_cpu);

/**
- * ring_buffer_reset_cpu - reset a ring buffer per CPU buffer
+ * ring_buffer_reset_online_cpus - reset a ring buffer per CPU buffer
* @buffer: The ring buffer to reset a per cpu buffer of
* @cpu: The CPU buffer to be reset
*/
@@ -5375,7 +5375,7 @@ void ring_buffer_reset(struct trace_buffer *buffer)
EXPORT_SYMBOL_GPL(ring_buffer_reset);

/**
- * rind_buffer_empty - is the ring buffer empty?
+ * ring_buffer_empty - is the ring buffer empty?
* @buffer: The ring buffer to test
*/
bool ring_buffer_empty(struct trace_buffer *buffer)
--
2.20.1.7.g153144c


2022-10-09 14:35:20

by Bagas Sanjaya

[permalink] [raw]
Subject: Re: [PATCH v2] ring-buffer: Fix kernel-doc

On Sun, Oct 09, 2022 at 10:06:42AM +0800, Jiapeng Chong wrote:
> kernel/trace/ring_buffer.c:895: warning: expecting prototype for ring_buffer_nr_pages_dirty(). Prototype was for ring_buffer_nr_dirty_pages() instead.
> kernel/trace/ring_buffer.c:5313: warning: expecting prototype for ring_buffer_reset_cpu(). Prototype was for ring_buffer_reset_online_cpus() instead.
> kernel/trace/ring_buffer.c:5382: warning: expecting prototype for rind_buffer_empty(). Prototype was for ring_buffer_empty() instead.
>

Describe what this patch does to fix these warnings. Remember to write
in imperative mood. (Actually I figured out what you are doing, see
below).

> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2340
> Reported-by: Abaci Robot <[email protected]>
> Signed-off-by: Jiapeng Chong <[email protected]>
> ---
> Changes in v2:
> -Get rid of the parenthesis.
>
> kernel/trace/ring_buffer.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> index c3f354cfc5ba..199759c73519 100644
> --- a/kernel/trace/ring_buffer.c
> +++ b/kernel/trace/ring_buffer.c
> @@ -885,7 +885,7 @@ size_t ring_buffer_nr_pages(struct trace_buffer *buffer, int cpu)
> }
>
> /**
> - * ring_buffer_nr_pages_dirty - get the number of used pages in the ring buffer
> + * ring_buffer_nr_dirty_pages - get the number of used pages in the ring buffer
> * @buffer: The ring_buffer to get the number of pages from
> * @cpu: The cpu of the ring_buffer to get the number of pages from
> *
> @@ -5305,7 +5305,7 @@ void ring_buffer_reset_cpu(struct trace_buffer *buffer, int cpu)
> EXPORT_SYMBOL_GPL(ring_buffer_reset_cpu);
>
> /**
> - * ring_buffer_reset_cpu - reset a ring buffer per CPU buffer
> + * ring_buffer_reset_online_cpus - reset a ring buffer per CPU buffer
> * @buffer: The ring buffer to reset a per cpu buffer of
> * @cpu: The CPU buffer to be reset
> */
> @@ -5375,7 +5375,7 @@ void ring_buffer_reset(struct trace_buffer *buffer)
> EXPORT_SYMBOL_GPL(ring_buffer_reset);
>
> /**
> - * rind_buffer_empty - is the ring buffer empty?
> + * ring_buffer_empty - is the ring buffer empty?
> * @buffer: The ring buffer to test
> */
> bool ring_buffer_empty(struct trace_buffer *buffer)

Oh, these warnings above are due to mismatched function name, right?

Thanks.

--
An old man doll... just what I always wanted! - Clara


Attachments:
(No filename) (2.44 kB)
signature.asc (235.00 B)
Download all attachments