From: Simon Horman <simon.horman@corigine.com>
To: Alexandra Winter <wintera@linux.ibm.com>
Cc: David Miller <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>,
netdev@vger.kernel.org, linux-s390@vger.kernel.org,
Heiko Carstens <hca@linux.ibm.com>,
Thorsten Winkler <twinkler@linux.ibm.com>,
Jules Irenge <jbi.octave@gmail.com>
Subject: Re: [PATCH net-next 2/4] s390/lcs: Convert sprintf to scnprintf
Date: Tue, 20 Jun 2023 21:16:35 +0200 [thread overview]
Message-ID: <ZJH7E20GZ1YH8HSd@corigine.com> (raw)
In-Reply-To: <20230620083411.508797-3-wintera@linux.ibm.com>
On Tue, Jun 20, 2023 at 10:34:09AM +0200, Alexandra Winter wrote:
> From: Thorsten Winkler <twinkler@linux.ibm.com>
>
> This LWN article explains the rationale for this change
> https: //lwn.net/Articles/69419/
> Ie. snprintf() returns what *would* be the resulting length,
> while scnprintf() returns the actual length.
Hi Alexandra,
Although I agree that it's nice to use scnprintf() the justification given
seems a bit odd: it talks of the return value but it is ignored both before
and after this patch.
Likewise for some of the changes in patch 4/4.
Also is it intentional that there is a space in the URL immediately
after 'http:' ? Maybe mangled by something. Not that it really maters
AFAIC.
> Reported-by: Jules Irenge <jbi.octave@gmail.com>
> Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
> Signed-off-by: Thorsten Winkler <twinkler@linux.ibm.com>
> Signed-off-by: Alexandra Winter <wintera@linux.ibm.com>
> ---
> drivers/s390/net/lcs.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/s390/net/lcs.h b/drivers/s390/net/lcs.h
> index bd52caa3b11b..a2699b70b050 100644
> --- a/drivers/s390/net/lcs.h
> +++ b/drivers/s390/net/lcs.h
> @@ -21,7 +21,7 @@ do { \
> #define LCS_DBF_TEXT_(level,name,text...) \
> do { \
> if (debug_level_enabled(lcs_dbf_##name, level)) { \
> - sprintf(debug_buffer, text); \
> + scnprintf(debug_buffer, sizeof(debug_buffer), text); \
> debug_text_event(lcs_dbf_##name, level, debug_buffer); \
> } \
> } while (0)
> --
> 2.39.2
>
>
next prev parent reply other threads:[~2023-06-20 19:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-20 8:34 [PATCH net-next 0/4] s390/net: updates 2023-06-10 Alexandra Winter
2023-06-20 8:34 ` [PATCH net-next 1/4] s390/lcs: Convert sysfs sprintf to sysfs_emit Alexandra Winter
2023-06-20 19:17 ` Simon Horman
2023-06-20 8:34 ` [PATCH net-next 2/4] s390/lcs: Convert sprintf to scnprintf Alexandra Winter
2023-06-20 19:16 ` Simon Horman [this message]
2023-06-21 13:49 ` Alexandra Winter
2023-06-20 8:34 ` [PATCH net-next 3/4] s390/ctcm: Convert sysfs sprintf to sysfs_emit Alexandra Winter
2023-06-20 19:17 ` Simon Horman
2023-06-20 8:34 ` [PATCH net-next 4/4] s390/ctcm: Convert sprintf/snprintf to scnprintf Alexandra Winter
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=ZJH7E20GZ1YH8HSd@corigine.com \
--to=simon.horman@corigine.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hca@linux.ibm.com \
--cc=jbi.octave@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=twinkler@linux.ibm.com \
--cc=wintera@linux.ibm.com \
/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