perf/core: convert snprintf to scnprintf
PATCH 1/2 perf/core: convert snprintf to scnprintf
Coccinelle reports a warning
WARNING: use scnprintf or sprintf
Adding to that,
there has also been some slow migration from snprintf to scnprintf The article explains the rationale for this change
https: //lwn.net/Articles/69419/
Signed-off-by Jules Irenge <[email protected]>
--- kernel/events/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/events/core.c +3 -3
@@ -10933,7 +10933,7 @@ static ssize_t nr_addr_filters_show(struct device *dev, {struct pmu *pmu =dev_get_drvdata (dev); -return snprintf (page,PAGE_SIZE -1 ,"%d\n" , pmu->nr_addr_filters); +return scnprintf (page,PAGE_SIZE -1 ,"%d\n" , pmu->nr_addr_filters); }DEVICE_ATTR_RO (nr_addr_filters);
@@ -10944,7 +10944,7 @@ type_show(struct device *dev, struct device_attribute *attr, char *page) {struct pmu *pmu =dev_get_drvdata (dev); -return snprintf (page,PAGE_SIZE -1 ,"%d\n" , pmu->type); +return scnprintf (page,PAGE_SIZE -1 ,"%d\n" , pmu->type); }static DEVICE_ATTR_RO (type);
@@ -10955,7 +10955,7 @@ perf_event_mux_interval_ms_show(struct device *dev, {struct pmu *pmu =dev_get_drvdata (dev); -return snprintf (page,PAGE_SIZE -1 ,"%d\n" , pmu->hrtimer_interval_ms); +return scnprintf (page,PAGE_SIZE -1 ,"%d\n" , pmu->hrtimer_interval_ms); }static DEFINE_MUTEX (mux_interval_mutex);
Signature · 1 line
2.35.1
Peter Zijlstra
maintainerQuoted 9 lines · Jules Irenge
Coccinelle reports a warning
WARNING: use scnprintf or sprintf
Adding to that,
there has also been some slow migration from snprintf to scnprintf The article explains the rationale for this changehttps: //lwn.net/Articles/69419/
Please but at least a bare minimum of justification in the Changelog itself. I can't be arsed to wade through the interweb in order to figure out if this patch has merit or is just whitespace wankery.