Skip to contentSkip to conversation

tracing: Fix kernel-doc

PATCH Superseded Jiapeng Chong 2 participants 2 messages Feb 16, 2022 Tracing

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tracing: Fix kernel-doc

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.

---
 kernel/trace/trace.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/trace/trace.c +4 -4
index 7c2578efde26..326d96304b84 100644
@@ -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
Signature · 1 line
2.20.1.7.g153144c
#1 lore raw
Quoted 8 lines · Jiapeng Chong

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.

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

kernel/trace/trace.c void tracing_snapshot_instance(struct trace_array *tr) · line 1125

Quoted 13 lines
 kernel/trace/trace.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/trace/trace.c +1 -1
index 7c2578efde26..326d96304b84 100644
@@ -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.

kernel/trace/trace.c void tracing_snapshot(void) · line 1148

Quoted 10 lines
kernel/trace/trace.c +1 -1
  * 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.

kernel/trace/trace.c void tracing_snapshot_cond(struct trace_array *tr, void *cond_data) · line 1167

Quoted 10 lines
kernel/trace/trace.c +2 -2
  * @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