lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 22 Jan 2020 18:45:43 -0800
From:   Bart Van Assche <bvanassche@....org>
To:     Chen Zhou <chenzhou10@...wei.com>, hmadhani@...vell.com,
        jejb@...ux.ibm.com, martin.petersen@...cle.com
Cc:     linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] scsi: qla2xxx: use PTR_ERR_OR_ZERO() to simplify
 code

On 2020-01-22 02:18, Chen Zhou wrote:
> PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR, just use 
> PTR_ERR_OR_ZERO directly.
> 
> Signed-off-by: Chen Zhou <chenzhou10@...wei.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 abe7f79..719d53d 100644
> --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
> +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
> @@ -1462,10 +1462,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);
>  }

Is this a useful change? My personal opinion is that the current
implementation (without this patch) is easier to read.

Thanks,

Bart.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ