From: "tip-bot2 for Jules Irenge" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Jules Irenge <jbi.octave@gmail.com>,
Ingo Molnar <mingo@kernel.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: perf/core] perf/core: Convert snprintf() to scnprintf()
Date: Wed, 21 Sep 2022 08:08:55 -0000 [thread overview]
Message-ID: <166374773592.401.16831946846027095231.tip-bot2@tip-bot2> (raw)
The following commit has been merged into the perf/core branch of tip:
Commit-ID: 678739d622ae7b75b62d550858b6bf104c43e2df
Gitweb: https://git.kernel.org/tip/678739d622ae7b75b62d550858b6bf104c43e2df
Author: Jules Irenge <jbi.octave@gmail.com>
AuthorDate: Sun, 18 Sep 2022 00:41:08 +01:00
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Wed, 21 Sep 2022 10:01:20 +02:00
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.
This LWN article explains the rationale for this change:
https: //lwn.net/Articles/69419/
No change in behavior.
[ mingo: Improved the changelog. ]
Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/events/core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 7da5515..c07e9a3 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -10952,7 +10952,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);
@@ -10963,7 +10963,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);
@@ -10974,7 +10974,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);
next reply other threads:[~2022-09-21 8:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-21 8:08 tip-bot2 for Jules Irenge [this message]
2022-09-21 8:34 ` Peter Zijlstra
2022-09-21 10:44 ` Ingo Molnar
2022-09-21 12:55 ` David Sterba
2022-09-29 8:28 ` Jules Irenge
2022-09-21 11:58 ` Jules Irenge
2022-09-21 10:40 tip-bot2 for Jules Irenge
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=166374773592.401.16831946846027095231.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=jbi.octave@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®