[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y+T1+N87vYBjeaqM@corigine.com>
Date: Thu, 9 Feb 2023 14:32:40 +0100
From: Simon Horman <simon.horman@...igine.com>
To: Alexandra Winter <wintera@...ux.ibm.com>
Cc: David Miller <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
linux-s390@...r.kernel.org, Heiko Carstens <hca@...ux.ibm.com>,
Thorsten Winkler <twinkler@...ux.ibm.com>,
Jules Irenge <jbi.octave@...il.com>,
Joe Perches <joe@...ches.com>
Subject: Re: [PATCH net-next v2 3/4] s390/qeth: Convert sysfs sprintf to
sysfs_emit
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@...ux.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@...igine.com>
Powered by blists - more mailing lists