From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: YueHaibing <yuehaibing@huawei.com>
Cc: <hare@suse.de>, <jejb@linux.ibm.com>,
<martin.petersen@oracle.com>, <linux-scsi@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] scsi: libfc: Fix passing zero to 'PTR_ERR' warning
Date: Thu, 20 Aug 2020 22:21:49 -0400 [thread overview]
Message-ID: <yq1ft8gvje1.fsf@ca-mkp.ca.oracle.com> (raw)
In-Reply-To: <20200819020546.59172-1-yuehaibing@huawei.com> (yuehaibing@huawei.com's message of "Wed, 19 Aug 2020 10:05:46 +0800")
YueHaibing,
> diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
> index d8cbc9c0e766..574e842cefed 100644
> --- a/drivers/scsi/libfc/fc_disc.c
> +++ b/drivers/scsi/libfc/fc_disc.c
> @@ -302,7 +302,7 @@ static void fc_disc_error(struct fc_disc *disc, struct fc_frame *fp)
> unsigned long delay = 0;
>
> FC_DISC_DBG(disc, "Error %ld, retries %d/%d\n",
> - PTR_ERR(fp), disc->retry_count,
> + IS_ERR(fp) ? PTR_ERR(fp) : 0, disc->retry_count,
> FC_DISC_RETRY_LIMIT);
>
> if (!fp || PTR_ERR(fp) == -FC_EX_TIMEOUT) {
Why not PTR_ERR_OR_ZERO()?
--
Martin K. Petersen Oracle Linux Engineering
next prev parent reply other threads:[~2020-08-21 2:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-18 11:42 [PATCH] scsi: libfc: Fix passing zero to 'PTR_ERR' warning YueHaibing
2020-08-18 16:24 ` kernel test robot
2020-08-19 2:05 ` [PATCH v2] " YueHaibing
2020-08-21 2:21 ` Martin K. Petersen [this message]
2020-08-21 11:03 ` Yuehaibing
2020-08-21 11:02 ` [PATCH v3] " YueHaibing
2020-08-21 12:23 ` [PATCH] " Dan Carpenter
2020-09-09 13:54 ` [PATCH v4] " YueHaibing
2020-09-15 21:52 ` Martin K. Petersen
2020-09-22 3:57 ` Martin K. Petersen
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=yq1ft8gvje1.fsf@ca-mkp.ca.oracle.com \
--to=martin.petersen@oracle.com \
--cc=hare@suse.de \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@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;
as well as URLs for NNTP newsgroup(s).