Skip to contentSkip to conversation

events: core: make perf_pmu_snapshot_aux static

PATCH Superseded Pavel Skripkin 2 participants 3 messages Jun 8, 2021 – Jun 9, 2021 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 events: core: make perf_pmu_snapshot_aux static

Sparse says:
warning: symbol 'perf_pmu_snapshot_aux' was not declared. Should it be static?

Since perf_pmu_snapshot_aux() is not used outside this file, it can be made static

---
 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/events/core.c +1 -1
index 6fee4a7e88d7..0d98d6a6f949 100644
@@ -6667,7 +6667,7 @@ static unsigned long perf_prepare_sample_aux(struct perf_event *event,
 	return data->aux_size;
 }
 
-long perf_pmu_snapshot_aux(struct perf_buffer *rb,
+static long perf_pmu_snapshot_aux(struct perf_buffer *rb,
 			   struct perf_event *event,
 			   struct perf_output_handle *handle,
 			   unsigned long size)
Signature · 1 line
2.31.1
maintainer
#1 lore raw
Quoted 16 lines · Pavel Skripkin

Sparse says:
warning: symbol 'perf_pmu_snapshot_aux' was not declared. Should it be static?

Since perf_pmu_snapshot_aux() is not used outside this file, it can be made static

---
 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/events/core.c +0 -0
index 6fee4a7e88d7..0d98d6a6f949 100644

kernel/events/core.c static unsigned long perf_prepare_sample_aux(struct perf_event *event, · line 6673

Quoted 8 lines
kernel/events/core.c +1 -1
@@ -6667,7 +6667,7 @@ static unsigned long perf_prepare_sample_aux(struct perf_event *event,
 	return data->aux_size;
 }
 
-long perf_pmu_snapshot_aux(struct perf_buffer *rb,
+static long perf_pmu_snapshot_aux(struct perf_buffer *rb,
 			   struct perf_event *event,
 			   struct perf_output_handle *handle,
 			   unsigned long size)

You've just ruined the alignment of the arguments, also you subject has the wrong prefix, see to git log for suggestions.

#2 lore raw

PATCH v2 1/1 perf: events: make perf_pmu_snapshot_aux static

Sparse says:
warning: symbol 'perf_pmu_snapshot_aux' was not declared. Should it be static?

Since perf_pmu_snapshot_aux() is not used outside this file, it can be made static

---

Changes in v2:
Changed subject line
Fixed alignment of the arguments

---
 kernel/events/core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/events/core.c +4 -4
index 6fee4a7e88d7..9ad01ff5692b 100644
@@ -6667,10 +6667,10 @@ static unsigned long perf_prepare_sample_aux(struct perf_event *event,
 	return data->aux_size;
 }
 
-long perf_pmu_snapshot_aux(struct perf_buffer *rb,
-			   struct perf_event *event,
-			   struct perf_output_handle *handle,
-			   unsigned long size)
+static long perf_pmu_snapshot_aux(struct perf_buffer *rb,
+				  struct perf_event *event,
+				  struct perf_output_handle *handle,
+				  unsigned long size)
 {
 	unsigned long flags;
 	long ret;
Signature · 1 line
2.31.1