From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Chen Zhou <chenzhou10@huawei.com>
Cc: gor@linux.ibm.com, borntraeger@de.ibm.com,
linux-s390@vger.kernel.or, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next 0/3] s390: use scnprintf() in show() methods
Date: Mon, 8 Jun 2020 16:25:56 +0200 [thread overview]
Message-ID: <20200608142556.GA7478@osiris> (raw)
In-Reply-To: <20200509085608.41061-1-chenzhou10@huawei.com>
On Sat, May 09, 2020 at 04:56:05PM +0800, Chen Zhou wrote:
> snprintf() returns the number of bytes that would be written,
> which may be greater than the the actual length to be written.
>
> show() methods should return the number of bytes printed into the
> buffer. This is the return value of scnprintf().
>
> Chen Zhou (3):
> s390/crypto: use scnprintf() instead of snprintf()
> s390: use scnprintf() in sys_##_prefix##_##_name##_show
> s390/protvirt: use scnprintf() instead of snprintf()
>
> arch/s390/crypto/prng.c | 14 +++++++-------
> arch/s390/kernel/ipl.c | 2 +-
> arch/s390/kernel/uv.c | 8 ++++----
> 3 files changed, 12 insertions(+), 12 deletions(-)
All applied, even though the buffer has a size of 4k in all cases.
So this doesn't fix anything; but it doesn't hurt as well.
prev parent reply other threads:[~2020-06-08 14:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-09 8:56 [PATCH -next 0/3] s390: use scnprintf() in show() methods Chen Zhou
2020-05-09 8:56 ` [PATCH -next 1/3] s390/crypto: use scnprintf() instead of snprintf() Chen Zhou
2020-05-09 8:56 ` [PATCH -next 2/3] s390: use scnprintf() in sys_##_prefix##_##_name##_show Chen Zhou
2020-05-09 8:56 ` [PATCH -next 3/3] s390/protvirt: use scnprintf() instead of snprintf() Chen Zhou
2020-06-08 14:25 ` Heiko Carstens [this message]
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=20200608142556.GA7478@osiris \
--to=heiko.carstens@de.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=chenzhou10@huawei.com \
--cc=gor@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.or \
/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