linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tracing: Fix kernel-doc
@ 2022-02-16  7:58 Jiapeng Chong
  2022-02-16 16:04 ` Jonathan Corbet
  0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2022-02-16  7:58 UTC (permalink / raw)
  To: rostedt; +Cc: mingo, linux-kernel, Jiapeng Chong, Abaci Robot

Fix the following W=1 kernel warnings:

kernel/trace/trace.c:1181: warning: expecting prototype for
tracing_snapshot_cond_data(). Prototype was for
tracing_cond_snapshot_data() instead.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 kernel/trace/trace.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 7c2578efde26..326d96304b84 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1122,7 +1122,7 @@ void tracing_snapshot_instance(struct trace_array *tr)
 	tracing_snapshot_instance_cond(tr, NULL);
 }
 
-/**
+/*
  * tracing_snapshot - take a snapshot of the current buffer.
  *
  * This causes a swap between the snapshot buffer and the current live
@@ -1144,7 +1144,7 @@ void tracing_snapshot(void)
 }
 EXPORT_SYMBOL_GPL(tracing_snapshot);
 
-/**
+/*
  * tracing_snapshot_cond - conditionally take a snapshot of the current buffer.
  * @tr:		The tracing instance to snapshot
  * @cond_data:	The data to be tested conditionally, and possibly saved
@@ -1163,8 +1163,8 @@ void tracing_snapshot_cond(struct trace_array *tr, void *cond_data)
 }
 EXPORT_SYMBOL_GPL(tracing_snapshot_cond);
 
-/**
- * tracing_snapshot_cond_data - get the user data associated with a snapshot
+/*
+ * tracing_cond_snapshot_data - get the user data associated with a snapshot
  * @tr:		The tracing instance
  *
  * When the user enables a conditional snapshot using
-- 
2.20.1.7.g153144c


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tracing: Fix kernel-doc
  2022-02-16  7:58 [PATCH] tracing: Fix kernel-doc Jiapeng Chong
@ 2022-02-16 16:04 ` Jonathan Corbet
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Corbet @ 2022-02-16 16:04 UTC (permalink / raw)
  To: Jiapeng Chong, rostedt; +Cc: mingo, linux-kernel, Jiapeng Chong, Abaci Robot

Jiapeng Chong <jiapeng.chong@linux.alibaba.com> writes:

> Fix the following W=1 kernel warnings:
>
> kernel/trace/trace.c:1181: warning: expecting prototype for
> tracing_snapshot_cond_data(). Prototype was for
> tracing_cond_snapshot_data() instead.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>

Thank you for working to fix docs warnings.  Unfortunately, this is not
the correct fix.

>  kernel/trace/trace.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 7c2578efde26..326d96304b84 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -1122,7 +1122,7 @@ void tracing_snapshot_instance(struct trace_array *tr)
>  	tracing_snapshot_instance_cond(tr, NULL);
>  }
>  
> -/**
> +/*

Here you are removing kerneldoc markup for comments that are entirely
unrelated to the warning in question.  Why are you doing that?  That
will remove this documentation (for an exported function) from the docs
build. 

>   * tracing_snapshot - take a snapshot of the current buffer.
>   *
>   * This causes a swap between the snapshot buffer and the current live
> @@ -1144,7 +1144,7 @@ void tracing_snapshot(void)
>  }
>  EXPORT_SYMBOL_GPL(tracing_snapshot);
>  
> -/**
> +/*
>   * tracing_snapshot_cond - conditionally take a snapshot of the current buffer.

The same question applies here.

>   * @tr:		The tracing instance to snapshot
>   * @cond_data:	The data to be tested conditionally, and possibly saved
> @@ -1163,8 +1163,8 @@ void tracing_snapshot_cond(struct trace_array *tr, void *cond_data)
>  }
>  EXPORT_SYMBOL_GPL(tracing_snapshot_cond);
>  
> -/**
> - * tracing_snapshot_cond_data - get the user data associated with a snapshot
> +/*
> + * tracing_cond_snapshot_data - get the user data associated with a snapshot

Here you got the right fix - getting the name of the function right in
the comment - but you still took out the kerneldoc marker.

These changes have the effect of making the warning go away (and more),
but don't fix the real problem - that tracing_cond_snapshot_data() has
incorrect kerneldoc documentation.  Unless I'm missing something
fundamental (which happens often), the right fix is just the change of
function name in the comment.

Thanks,

jon

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-16 16:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-16  7:58 [PATCH] tracing: Fix kernel-doc Jiapeng Chong
2022-02-16 16:04 ` Jonathan Corbet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).