From: Bart Van Assche <bvanassche@acm.org>
To: Samuel Zou <zou_wei@huawei.com>,
njavali@marvell.com, GR-QLogic-Storage-Upstream@marvell.com,
jejb@linux.ibm.com, martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] scsi: qla2xxx: Use PTR_ERR_OR_ZERO() to simplify code
Date: Wed, 6 May 2020 08:42:12 -0700 [thread overview]
Message-ID: <5693adb3-8f5c-efcc-8e63-38a8311c90b9@acm.org> (raw)
In-Reply-To: <1588751650-37186-1-git-send-email-zou_wei@huawei.com>
On 2020-05-06 00:54, Samuel Zou wrote:
> Fixes coccicheck warning:
>
> drivers/scsi/qla2xxx/tcm_qla2xxx.c:1488:1-3: WARNING: PTR_ERR_OR_ZERO can be used
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Samuel Zou <zou_wei@huawei.com>
> ---
> drivers/scsi/qla2xxx/tcm_qla2xxx.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
> index 1f0a185..7c4157e 100644
> --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
> +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
> @@ -1485,10 +1485,8 @@ static int tcm_qla2xxx_check_initiator_node_acl(
> sizeof(struct qla_tgt_cmd),
> TARGET_PROT_ALL, port_name,
> qlat_sess, tcm_qla2xxx_session_cb);
> - if (IS_ERR(se_sess))
> - return PTR_ERR(se_sess);
>
> - return 0;
> + return PTR_ERR_OR_ZERO(se_sess);
> }
Can the Hulk check that verifies where PTR_ERR_OR_ZERO() can be
introduced be deactivated? I think this patch makes the code less
readable instead of making it more readable.
Thanks,
Bart.
next prev parent reply other threads:[~2020-05-06 15:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-06 7:54 [PATCH -next] scsi: qla2xxx: Use PTR_ERR_OR_ZERO() to simplify code Samuel Zou
2020-05-06 15:42 ` Bart Van Assche [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-01-22 10:18 [PATCH -next] scsi: qla2xxx: use " Chen Zhou
2020-01-23 2:45 ` Bart Van Assche
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=5693adb3-8f5c-efcc-8e63-38a8311c90b9@acm.org \
--to=bvanassche@acm.org \
--cc=GR-QLogic-Storage-Upstream@marvell.com \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=njavali@marvell.com \
--cc=zou_wei@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).