[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ba5e5ccf-59fa-4c7f-b649-97c19b2008a0@moroto.mountain>
Date: Tue, 23 Apr 2024 18:41:48 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Nick Child <nnac123@...ux.ibm.com>
Cc: Paolo Abeni <pabeni@...hat.com>, Markus Elfring <Markus.Elfring@....de>,
linuxppc-dev@...ts.ozlabs.org, netdev@...r.kernel.org,
kernel-janitors@...r.kernel.org,
"Aneesh Kumar K.V" <aneesh.kumar@...nel.org>,
Christophe Leroy <christophe.leroy@...roup.eu>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Haren Myneni <haren@...ux.ibm.com>,
Jakub Kicinski <kuba@...nel.org>,
Michael Ellerman <mpe@...erman.id.au>,
"Naveen N. Rao" <naveen.n.rao@...ux.ibm.com>,
Nicholas Piggin <npiggin@...il.com>,
Rick Lindsley <ricklind@...ux.ibm.com>,
Thomas Falcon <tlfalcon@...ux.ibm.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ibmvnic: Use -EBUSY in __ibmvnic_reset()
On Tue, Apr 23, 2024 at 09:55:57AM -0500, Nick Child wrote:
> > You're right that it doesn't affect the behavior of the driver except
> > for the debug output when we do:
> >
> > netdev_dbg(adapter->netdev, "Reset failed, rc=%d\n", rc);
> >
> > But the - was left off uninitentionally so I think we should apply it.
> >
> > I have been trying to look for similar bugs where the - is left off.
> > It's a bit challenging because there places where we use positive
> > error codes deliberately. But in this case a static checker could
> > easily detect the bug with a low false positive ratio by saying, "We're
> > mixing normal negative error codes with positive EBUSY".
> >
> > regards,
> > dan carpenter
>
> Hello, small clarification, this patch will not effect the debug print
> statement due to the break statement immediately following:
> while () {
> if () {
> rc = -EBUSY;
> break;
> }
> netdev_dbg(adapter->netdev, "Reset failed, rc=%d\n", rc);
> }
> Though this return code can be passed to adapter->reset_done_rc, which is
> only treated as a boolean.
>
> So, the point of the patch not doing any behavioral differences is still
> true.
Ah yes. You're right.
regards,
dan carpenter
Powered by blists - more mailing lists