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] [thread-next>] [day] [month] [year] [list]
Message-ID: <OF03100A62.8FDD44EE-ON0025879F.00427DFD-0025879F.004294C9@ibm.com>
Date:   Thu, 2 Dec 2021 12:07:14 +0000
From:   "Bernard Metzler" <BMT@...ich.ibm.com>
To:     "Jiapeng Chong" <jiapeng.chong@...ux.alibaba.com>
Cc:     jgg@...pe.ca, linux-rdma@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] RDMA/siw: Use max() instead of doing it manually

-----"Jiapeng Chong" <jiapeng.chong@...ux.alibaba.com> wrote: -----

>To: bmt@...ich.ibm.com
>From: "Jiapeng Chong" <jiapeng.chong@...ux.alibaba.com>
>Date: 12/02/2021 11:08AM
>Cc: jgg@...pe.ca, linux-rdma@...r.kernel.org,
>linux-kernel@...r.kernel.org, "Jiapeng Chong"
><jiapeng.chong@...ux.alibaba.com>
>Subject: [EXTERNAL] [PATCH] RDMA/siw: Use max() instead of doing it
>manually
>
>Fix following coccicheck warning:
>
>./drivers/infiniband/sw/siw/siw_verbs.c:665:28-29: WARNING
>opportunity
>for max().
>
>Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
>Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.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 d15a1f9..a3dd2cb 100644
>--- a/drivers/infiniband/sw/siw/siw_verbs.c
>+++ b/drivers/infiniband/sw/siw/siw_verbs.c
>@@ -662,7 +662,7 @@ static int siw_copy_inline_sgl(const struct
>ib_send_wr *core_wr,
> 		kbuf += core_sge->length;
> 		core_sge++;
> 	}
>-	sqe->sge[0].length = bytes > 0 ? bytes : 0;
>+	sqe->sge[0].length = max(bytes, 0);
> 	sqe->num_sge = bytes > 0 ? 1 : 0;
> 
> 	return bytes;
>-- 
>1.8.3.1
>
>
Looks good, thanks!

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ