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>,
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>,
Joe Perches <joe@perches.com>
Subject: Re: [PATCH net-next v2 3/4] s390/qeth: Convert sysfs sprintf to sysfs_emit
Date: Thu, 9 Feb 2023 14:32:40 +0100 [thread overview]
Message-ID: <Y+T1+N87vYBjeaqM@corigine.com> (raw)
In-Reply-To: <36189f0d-82ec-36f8-c093-1947ebbe3160@linux.ibm.com>
On Thu, Feb 09, 2023 at 01:57:04PM +0100, Alexandra Winter wrote:
>
>
> On 09.02.23 12:27, Simon Horman wrote:
> > On Thu, Feb 09, 2023 at 12:04:23PM +0100, Alexandra Winter wrote:
> >> From: Thorsten Winkler <twinkler@linux.ibm.com>
> ...
> >>
> >> - entry_len = qeth_l3_ipaddr_to_string(proto, ipatoe->addr,
> >> - addr_str);
> >> - if (entry_len < 0)
> >> - continue;
> >
> > Here the return code of qeth_l3_ipaddr_to_string() is checked for an error.
> >
> >> -
> >> - /* Append /%mask to the entry: */
> >> - entry_len += 1 + ((proto == QETH_PROT_IPV4) ? 2 : 3);
> >> - /* Enough room to format %entry\n into null terminated page? */
> >> - if (entry_len + 1 > PAGE_SIZE - str_len - 1)
> >> - break;
> >> -
> >> - entry_len = scnprintf(buf, PAGE_SIZE - str_len,
> >> - "%s/%i\n", addr_str, ipatoe->mask_bits);
> >> - str_len += entry_len;
> >> - buf += entry_len;
> >> + qeth_l3_ipaddr_to_string(proto, ipatoe->addr, addr_str);
> >
> > But here it is not. Is that ok?
> >
> > Likewise in qeth_l3_dev_ip_add_show().
>
> As you pointed out in your comments to patch 4/4 v1,
> qeth_l3_ipaddr_to_string() will never return a negative value, as it only
> returns the result of s*printf() which at least in this usecase here will
> never return < 0.
Indeed I did. I just wanted to be sure this was intentional.
As it is, I am happy.
Reviewed-by: Simon Horman <simon.horman@corigine.com>
next prev parent reply other threads:[~2023-02-09 13:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-09 11:04 [PATCH net-next v2 0/4] s390/net: updates 2023-02-06 Alexandra Winter
2023-02-09 11:04 ` [PATCH net-next v2 1/4] s390/ctcm: cleanup indenting Alexandra Winter
2023-02-09 11:04 ` [PATCH net-next v2 2/4] s390/qeth: Use constant for IP address buffers Alexandra Winter
2023-02-09 11:24 ` Simon Horman
2023-02-09 11:04 ` [PATCH net-next v2 3/4] s390/qeth: Convert sysfs sprintf to sysfs_emit Alexandra Winter
2023-02-09 11:27 ` Simon Horman
2023-02-09 12:57 ` Alexandra Winter
2023-02-09 13:32 ` Simon Horman [this message]
2023-02-09 11:04 ` [PATCH net-next v2 4/4] s390/qeth: Convert sprintf/snprintf to scnprintf Alexandra Winter
2023-02-11 4:00 ` [PATCH net-next v2 0/4] s390/net: updates 2023-02-06 patchwork-bot+netdevbpf
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=Y+T1+N87vYBjeaqM@corigine.com \
--to=simon.horman@corigine.com \
--cc=davem@davemloft.net \
--cc=hca@linux.ibm.com \
--cc=jbi.octave@gmail.com \
--cc=joe@perches.com \
--cc=kuba@kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).