All of lore.kernel.org
 help / color / mirror / Atom feed
From: zhengbin <zhengbin13@huawei.com>
To: <hmadhani@marvell.com>, <jejb@linux.ibm.com>,
	<martin.petersen@oracle.com>, <linux-scsi@vger.kernel.org>
Cc: <zhengbin13@huawei.com>
Subject: [PATCH -next v2] scsi: qla2xxx: Use PTR_ERR_OR_ZERO() to simplify code
Date: Mon, 18 Nov 2019 18:43:12 +0800	[thread overview]
Message-ID: <1574073792-26475-1-git-send-email-zhengbin13@huawei.com> (raw)

Fixes coccicheck warning:

drivers/scsi/qla2xxx/tcm_qla2xxx.c:1462:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/scsi/qla2xxx/tcm_qla2xxx.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
index 042a2431..a82ad17 100644
--- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
+++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
@@ -1459,10 +1459,7 @@ 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);
 }

 static void tcm_qla2xxx_update_sess(struct fc_port *sess, port_id_t s_id,
--
2.7.4


             reply	other threads:[~2019-11-18 10:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-18 10:43 zhengbin [this message]
2019-11-18 10:44 ` [PATCH -next v2] scsi: qla2xxx: Use PTR_ERR_OR_ZERO() to simplify code zhengbin (A)

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=1574073792-26475-1-git-send-email-zhengbin13@huawei.com \
    --to=zhengbin13@huawei.com \
    --cc=hmadhani@marvell.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.