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]
Message-ID:
 <SA0SPRMB00053E316F50D2A70B37E3A89988A@SA0SPRMB0005.namprd15.prod.outlook.com>
Date: Wed, 7 May 2025 14:04:36 +0000
From: Bernard Metzler <BMT@...ich.ibm.com>
To: Colin Ian King <colin.i.king@...il.com>, Jason Gunthorpe <jgg@...pe.ca>,
        Leon Romanovsky <leon@...nel.org>,
        "linux-rdma@...r.kernel.org"
	<linux-rdma@...r.kernel.org>
CC: "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE:  [PATCH][next] RDMA/siw: replace redundant ternary operator with just
 rv



> -----Original Message-----
> From: Colin Ian King <colin.i.king@...il.com>
> Sent: Wednesday, May 7, 2025 3:19 PM
> To: Bernard Metzler <BMT@...ich.ibm.com>; Jason Gunthorpe <jgg@...pe.ca>;
> Leon Romanovsky <leon@...nel.org>; linux-rdma@...r.kernel.org
> Cc: kernel-janitors@...r.kernel.org; linux-kernel@...r.kernel.org
> Subject: [EXTERNAL] [PATCH][next] RDMA/siw: replace redundant ternary
> operator with just rv
> 
> The use of the ternary operator on rv is redundant, rv is
> either the initialized value of 0 or a negative error return
> code, so it can never be greater than zero, and hence the
> zero assignment in ternary operator is redundant. Just return
> rv instead.
> 
> Signed-off-by: Colin Ian King <colin.i.king@...il.com>
> ---
>  drivers/infiniband/sw/siw/siw_verbs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/sw/siw/siw_verbs.c
> b/drivers/infiniband/sw/siw/siw_verbs.c
> index 7ce0035c54fa..2b2a7b8e93b0 100644
> --- a/drivers/infiniband/sw/siw/siw_verbs.c
> +++ b/drivers/infiniband/sw/siw/siw_verbs.c
> @@ -1102,7 +1102,7 @@ int siw_post_receive(struct ib_qp *base_qp, const
> struct ib_recv_wr *wr,
>  		siw_dbg_qp(qp, "error %d\n", rv);
>  		*bad_wr = wr;
>  	}
> -	return rv > 0 ? 0 : rv;
> +	return rv;
>  }
> 
>  int siw_destroy_cq(struct ib_cq *base_cq, struct ib_udata *udata)
> --
> 2.49.0

Thanks Colin, makes sense.

Acked-by: Bernard Metzler <bmt@...ich.ibm.com> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ