From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: YueHaibing <yuehaibing@huawei.com>, davem@davemloft.net
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
intel-wired-lan@lists.osuosl.org
Subject: Re: [PATCH net-next] e100: Fix passing zero to 'PTR_ERR' warning in e100_load_ucode_wait
Date: Tue, 20 Nov 2018 16:03:18 -0800 [thread overview]
Message-ID: <95340aa60ea9a19a5c216e5863a368f05dbfeebd.camel@intel.com> (raw)
In-Reply-To: <20181119124819.15860-1-yuehaibing@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 1160 bytes --]
On Mon, 2018-11-19 at 20:48 +0800, YueHaibing wrote:
> Fix a static code checker warning:
> drivers/net/ethernet/intel/e100.c:1349
> e100_load_ucode_wait() warn: passing zero to 'PTR_ERR'
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> drivers/net/ethernet/intel/e100.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
This looks fine, I am just concerned of the regression testing needed on
hardware that is almost 20 years old now. The availability of the hardware
for testing is also a concern.
> diff --git a/drivers/net/ethernet/intel/e100.c
> b/drivers/net/ethernet/intel/e100.c
> index 7c4b554..736115b 100644
> --- a/drivers/net/ethernet/intel/e100.c
> +++ b/drivers/net/ethernet/intel/e100.c
> @@ -1345,8 +1345,8 @@ static inline int e100_load_ucode_wait(struct nic
> *nic)
>
> fw = e100_request_firmware(nic);
> /* If it's NULL, then no ucode is required */
> - if (!fw || IS_ERR(fw))
> - return PTR_ERR(fw);
> + if (IS_ERR_OR_NULL(fw))
> + return PTR_ERR_OR_ZERO(fw);
>
> if ((err = e100_exec_cb(nic, (void *)fw, e100_setup_ucode)))
> netif_err(nic, probe, nic->netdev,
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2018-11-21 0:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-19 12:48 [PATCH net-next] e100: Fix passing zero to 'PTR_ERR' warning in e100_load_ucode_wait YueHaibing
2018-11-21 0:03 ` Jeff Kirsher [this message]
2018-12-01 3:01 ` [Intel-wired-lan] " Brown, Aaron F
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=95340aa60ea9a19a5c216e5863a368f05dbfeebd.camel@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=davem@davemloft.net \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=yuehaibing@huawei.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