sparse report build warning as follows: kernel/events/core.c:6493:6: warning: symbol 'perf_pmu_snapshot_aux' was not declared. Should it be static? kernel/events/core.c:10545:1: warning: symbol 'dev_attr_nr_addr_filters' was not declared. Should it be static? 'perf_pmu_snapshot_aux' and 'dev_attr_nr_addr_filters' are not used outside of this file, so mark them static. Reported-by: Hulk Robot <hulkci@xxxxxxxxxx> Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx> --- kernel/events/core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index 1449553a8d44..9465f30ad981 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -6490,10 +6490,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; @@ -10542,7 +10542,7 @@ static ssize_t nr_addr_filters_show(struct device *dev, return snprintf(page, PAGE_SIZE - 1, "%d\n", pmu->nr_addr_filters); } -DEVICE_ATTR_RO(nr_addr_filters); +static DEVICE_ATTR_RO(nr_addr_filters); static struct idr pmu_idr;