From: Shuah Khan <skhan@linuxfoundation.org>
To: Alexander Shishkin <alexander.shishkin@linux.intel.com>,
peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
mark.rutland@arm.com, jolsa@redhat.com, namhyung@kernel.org
Cc: linux-kernel@vger.kernel.org, Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH] kernel: events: Use scnprintf() in show_pmu_*() instead of snprintf()
Date: Wed, 9 Sep 2020 10:19:34 -0600 [thread overview]
Message-ID: <d0c52cb6-5eb2-8ea0-a1b4-c97f447835f6@linuxfoundation.org> (raw)
In-Reply-To: <87o8mfxxc4.fsf@ashishki-desk.ger.corp.intel.com>
On 9/9/20 12:45 AM, Alexander Shishkin wrote:
> Shuah Khan <skhan@linuxfoundation.org> writes:
>
>> Since snprintf() returns would-be-output size instead of the actual
>> output size, replace it with scnprintf(), so the nr_addr_filters_show(),
>> type_show(), and perf_event_mux_interval_ms_show() routines return the
>> actual size.
>
> Well, firstly they should just be sprintf()s, and secondly, I wouldn't
> worry about it, because [0].
scnprintf() or sprinf() could be used.
>
> [0] https://marc.info/?l=linux-kernel&m=159874491103969&w=2
Awesome. Thanks for the pointer. I wasn't aware of this work and
it takes care of the problem kernel wide. A better way to solve
the problem.
thanks,
-- Shuah
next prev parent reply other threads:[~2020-09-09 16:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-01 23:49 [PATCH] kernel: events: Use scnprintf() in show_pmu_*() instead of snprintf() Shuah Khan
2020-09-01 23:49 ` [PATCH] kernel: Use scnprintf() in show_smt_*() " Shuah Khan
2020-09-10 11:15 ` Qais Yousef
2020-09-09 6:45 ` [PATCH] kernel: events: Use scnprintf() in show_pmu_*() " Alexander Shishkin
2020-09-09 16:19 ` Shuah Khan [this message]
2020-09-09 17:27 ` Joe Perches
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=d0c52cb6-5eb2-8ea0-a1b4-c97f447835f6@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.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