* [PATCH -next v2] scsi: qla2xxx: Use PTR_ERR_OR_ZERO() to simplify code
@ 2019-11-18 10:43 zhengbin
2019-11-18 10:44 ` zhengbin (A)
0 siblings, 1 reply; 2+ messages in thread
From: zhengbin @ 2019-11-18 10:43 UTC (permalink / raw)
To: hmadhani, jejb, martin.petersen, linux-scsi; +Cc: zhengbin13
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next v2] scsi: qla2xxx: Use PTR_ERR_OR_ZERO() to simplify code
2019-11-18 10:43 [PATCH -next v2] scsi: qla2xxx: Use PTR_ERR_OR_ZERO() to simplify code zhengbin
@ 2019-11-18 10:44 ` zhengbin (A)
0 siblings, 0 replies; 2+ messages in thread
From: zhengbin (A) @ 2019-11-18 10:44 UTC (permalink / raw)
To: hmadhani, jejb, martin.petersen, linux-scsi
Actually it is v1, not v2 patch. my mistake...sorry for the confuse
On 2019/11/18 18:43, zhengbin wrote:
> 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
>
>
> .
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-11-18 10:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-18 10:43 [PATCH -next v2] scsi: qla2xxx: Use PTR_ERR_OR_ZERO() to simplify code zhengbin
2019-11-18 10:44 ` zhengbin (A)
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.