Re: [PATCH rdma-core] librdmacm: Remove unneeded condition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2017-11-02 at 15:51 +0200, Yuval Shaia wrote:
> The check makes no difference - remove it.
> 
> Signed-off-by: Yuval Shaia <yuval.shaia@xxxxxxxxxx>
> ---
>  librdmacm/cma.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/librdmacm/cma.c b/librdmacm/cma.c
> index 7aaf45f2..6eebe71b 100644
> --- a/librdmacm/cma.c
> +++ b/librdmacm/cma.c
> @@ -880,8 +880,8 @@ static int rdma_resolve_addr2(struct rdma_cm_id *id, struct sockaddr *src_addr,
>  	CMA_INIT_CMD(&cmd, sizeof cmd, RESOLVE_ADDR);
>  	id_priv = container_of(id, struct cma_id_private, id);
>  	cmd.id = id_priv->handle;
> -	if ((cmd.src_size = src_len))
> -		memcpy(&cmd.src_addr, src_addr, src_len);
> +	cmd.src_size = src_len;
> +	memcpy(&cmd.src_addr, src_addr, src_len);
>  	memcpy(&cmd.dst_addr, dst_addr, dst_len);
>  	cmd.dst_size = dst_len;
>  	cmd.timeout_ms = timeout_ms;

Shouldn't the description have been "Passing zero as third argument to
memcpy() is allowed so the if-test is not necessary. Hence leave it out"?

Bart.��.n��������+%������w��{.n�����{���fk��ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux